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

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: fix clang error 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
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 e89cad96eace2589d638e9a5be3b63c9d42d5c12..fdab8fe723442c3da4c3fcc40042cf0a61007da6 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_decoder_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 {
@@ -360,12 +362,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 frame callback after Release.
{

Powered by Google App Engine
This is Rietveld 408576698