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

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

Issue 19041006: Send video frames backed by textures to WebRTC. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 7 years, 4 months 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 | « content/renderer/media/native_handle_impl.cc ('k') | content/renderer/media/rtc_video_renderer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/rtc_video_decoder.cc
diff --git a/content/renderer/media/rtc_video_decoder.cc b/content/renderer/media/rtc_video_decoder.cc
index c048b6be722f89411850e5a15b681e47d8404e29..adce1f61b7e6dcb84bba726ce4050a797da031d0 100644
--- a/content/renderer/media/rtc_video_decoder.cc
+++ b/content/renderer/media/rtc_video_decoder.cc
@@ -12,8 +12,10 @@
#include "base/stl_util.h"
#include "base/task_runner_util.h"
#include "content/child/child_thread.h"
+#include "content/renderer/media/native_handle_impl.h"
#include "media/base/bind_to_loop.h"
#include "media/filters/gpu_video_accelerator_factories.h"
+#include "third_party/webrtc/common_video/interface/texture_video_frame.h"
#include "third_party/webrtc/system_wrappers/interface/ref_count.h"
namespace content {
@@ -362,12 +364,9 @@ void RTCVideoDecoder::PictureReady(const media::Picture& picture) {
DCHECK(inserted);
// Create a WebRTC video frame.
- // TODO(wuchengli): make media::VideoFrame an opaque native handle and put it
- // into WebRTC frame.
- webrtc::I420VideoFrame decoded_image;
- decoded_image.CreateEmptyFrame(
- width, height, width, (width + 1) / 2, (width + 1) / 2);
- decoded_image.set_timestamp(timestamp);
+ webrtc::RefCountImpl<NativeHandleImpl>* handle =
+ new webrtc::RefCountImpl<NativeHandleImpl>(frame);
+ webrtc::TextureVideoFrame decoded_image(handle, width, height, timestamp, 0);
// Invoke decode callback. WebRTC expects no callback after Reset or Release.
{
« no previous file with comments | « content/renderer/media/native_handle_impl.cc ('k') | content/renderer/media/rtc_video_renderer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698