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

Unified Diff: media/cast/cast_sender_impl.cc

Issue 688423003: [Cast] VideoFrameFactory interface to vend frames with encoder affinity. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 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
Index: media/cast/cast_sender_impl.cc
diff --git a/media/cast/cast_sender_impl.cc b/media/cast/cast_sender_impl.cc
index 571e92ef54093eb37c86221f8139c0eab5c1fe26..9d6ce84b53a359bce29b6cbdb0b2bb6a89a24291 100644
--- a/media/cast/cast_sender_impl.cc
+++ b/media/cast/cast_sender_impl.cc
@@ -18,8 +18,11 @@ namespace cast {
class LocalVideoFrameInput : public VideoFrameInput {
public:
LocalVideoFrameInput(scoped_refptr<CastEnvironment> cast_environment,
- base::WeakPtr<VideoSender> video_sender)
- : cast_environment_(cast_environment), video_sender_(video_sender) {}
+ base::WeakPtr<VideoSender> video_sender,
+ scoped_refptr<VideoFrameFactory> video_frame_factory)
+ : cast_environment_(cast_environment),
+ video_sender_(video_sender),
+ video_frame_factory_(video_frame_factory) {}
void InsertRawVideoFrame(const scoped_refptr<media::VideoFrame>& video_frame,
const base::TimeTicks& capture_time) override {
@@ -31,6 +34,10 @@ class LocalVideoFrameInput : public VideoFrameInput {
capture_time));
}
+ scoped_refptr<VideoFrame> CreateFrame(base::TimeDelta timestamp) override {
+ return video_frame_factory_->CreateFrame(timestamp);
Alpha Left Google 2014/11/17 20:23:14 Why not create VideoFrame through VideoSender?
jfroy 2014/11/17 21:23:06 My understanding is that VideoFrameInput is ref co
Alpha Left Google 2014/11/18 02:57:58 In a latter comment you mentioned that the created
jfroy 2014/11/18 18:03:58 That sounds pretty good.
+ }
+
protected:
~LocalVideoFrameInput() override {}
@@ -39,6 +46,7 @@ class LocalVideoFrameInput : public VideoFrameInput {
scoped_refptr<CastEnvironment> cast_environment_;
base::WeakPtr<VideoSender> video_sender_;
+ scoped_refptr<VideoFrameFactory> video_frame_factory_;
Alpha Left Google 2014/11/17 20:23:14 Please don't save VideoFrameFactory. It's an inter
jfroy 2014/11/17 21:23:06 See my note above. I made VideoFrameFactory a thre
DISALLOW_COPY_AND_ASSIGN(LocalVideoFrameInput);
};
@@ -170,7 +178,9 @@ void CastSenderImpl::OnVideoInitialized(
media::cast::CastInitializationStatus result) {
DCHECK(cast_environment_->CurrentlyOn(CastEnvironment::MAIN));
video_frame_input_ =
- new LocalVideoFrameInput(cast_environment_, video_sender_->AsWeakPtr());
+ new LocalVideoFrameInput(cast_environment_,
+ video_sender_->AsWeakPtr(),
+ video_sender_->video_frame_factory());
initialization_cb.Run(result);
}

Powered by Google App Engine
This is Rietveld 408576698