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

Unified Diff: content/renderer/media/video_capture_impl.cc

Issue 1413723014: Handle MJPEG HW Decode case in VideoCaptureImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 1 month 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/video_capture_impl.cc
diff --git a/content/renderer/media/video_capture_impl.cc b/content/renderer/media/video_capture_impl.cc
index 174344d88a1747fe47a34ed8a42211990473af24..8d09c2070116ab5f5dc6e53bf529dd96430c4056 100644
--- a/content/renderer/media/video_capture_impl.cc
+++ b/content/renderer/media/video_capture_impl.cc
@@ -359,7 +359,21 @@ void VideoCaptureImpl::OnBufferReceived(
weak_factory_.GetWeakPtr(), buffer_id, buffer));
} else {
scoped_refptr<ClientBuffer> buffer;
- if (storage_type == media::VideoFrame::STORAGE_UNOWNED_MEMORY) {
+ if (storage_type == media::VideoFrame::STORAGE_OPAQUE) {
+ DCHECK(mailbox_holder.mailbox.Verify());
+ DCHECK_EQ(media::PIXEL_FORMAT_ARGB, pixel_format);
+ frame = media::VideoFrame::WrapNativeTexture(
+ pixel_format,
+ mailbox_holder,
+ base::Bind(&SaveReleaseSyncToken, release_sync_token.get()),
+ coded_size,
+ gfx::Rect(coded_size),
+ coded_size,
+ timestamp - first_frame_timestamp_);
+ }
+ else {
+ DCHECK(storage_type == media::VideoFrame::STORAGE_UNOWNED_MEMORY ||
+ storage_type == media::VideoFrame::STORAGE_SHMEM);
DCHECK_EQ(media::PIXEL_FORMAT_I420, pixel_format);
const auto& iter = client_buffers_.find(buffer_id);
DCHECK(iter != client_buffers_.end());
@@ -375,16 +389,8 @@ void VideoCaptureImpl::OnBufferReceived(
buffer->buffer()->handle(),
0 /* shared_memory_offset */,
timestamp - first_frame_timestamp_);
- } else {
- DCHECK_EQ(storage_type, media::VideoFrame::STORAGE_OPAQUE);
- DCHECK(mailbox_holder.mailbox.Verify());
- DCHECK_EQ(media::PIXEL_FORMAT_ARGB, pixel_format);
- frame = media::VideoFrame::WrapNativeTexture(
- pixel_format, mailbox_holder,
- base::Bind(&SaveReleaseSyncToken, release_sync_token.get()),
- coded_size, gfx::Rect(coded_size), coded_size,
- timestamp - first_frame_timestamp_);
}
+ DCHECK(frame);
Pawel Osciak 2015/11/05 23:49:26 nullptr is a valid return value from Wrap*() metho
buffer_finished_callback = media::BindToCurrentLoop(
base::Bind(&VideoCaptureImpl::OnClientBufferFinished,
weak_factory_.GetWeakPtr(), buffer_id, buffer));
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698