Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(737)

Unified Diff: content/common/gpu/media/vaapi_video_encode_accelerator.cc

Issue 1541353002: Add offset support to BitstreamBuffer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Handle the offset with a helper class Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/common/gpu/media/vaapi_video_encode_accelerator.cc
diff --git a/content/common/gpu/media/vaapi_video_encode_accelerator.cc b/content/common/gpu/media/vaapi_video_encode_accelerator.cc
index 495f2f1b6876dfd7f6f8916dd9b612e7991deb83..00f38cd3d0d35115a23e99b413348eeb2d99f4aa 100644
--- a/content/common/gpu/media/vaapi_video_encode_accelerator.cc
+++ b/content/common/gpu/media/vaapi_video_encode_accelerator.cc
@@ -96,11 +96,10 @@ struct VaapiVideoEncodeAccelerator::InputFrameRef {
};
struct VaapiVideoEncodeAccelerator::BitstreamBufferRef {
- BitstreamBufferRef(int32 id, scoped_ptr<base::SharedMemory> shm, size_t size)
- : id(id), shm(shm.Pass()), size(size) {}
+ BitstreamBufferRef(int32 id, scoped_ptr<SharedMemoryRegion> shm)
+ : id(id), shm(shm.Pass()) {}
Pawel Osciak 2015/12/31 02:05:54 std::move
Owen Lin 2016/01/04 08:54:18 Done.
const int32 id;
const scoped_ptr<base::SharedMemory> shm;
- const size_t size;
};
media::VideoEncodeAccelerator::SupportedProfiles
@@ -663,15 +662,14 @@ void VaapiVideoEncodeAccelerator::UseOutputBitstreamBuffer(
return;
}
- scoped_ptr<base::SharedMemory> shm(
- new base::SharedMemory(buffer.handle(), false));
- if (!shm->Map(buffer.size())) {
+ scoped_ptr<SharedMemoryRegion> shm(new SharedMemoryRegion(buffer, false));
+ if (!shm->Map()) {
NOTIFY_ERROR(kPlatformFailureError, "Failed mapping shared memory.");
return;
}
- scoped_ptr<BitstreamBufferRef> buffer_ref(
- new BitstreamBufferRef(buffer.id(), shm.Pass(), buffer.size()));
+ scoped_ptr<BitstreamBufferRef> buffer_ref(new BitstreamBufferRef(
+ buffer.id(), shm.Pass(), buffer.offset(), buffer.size()));
Pawel Osciak 2015/12/31 02:05:54 I think we don't have this constructor in Bitstrea
Owen Lin 2016/01/04 08:54:18 Done.
encoder_thread_task_runner_->PostTask(
FROM_HERE,

Powered by Google App Engine
This is Rietveld 408576698