diff options
author | ronghuawu@chromium.org <ronghuawu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-05 23:36:52 +0000 |
---|---|---|
committer | ronghuawu@chromium.org <ronghuawu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-05-05 23:36:52 +0000 |
commit | 5294ec9616595ec4691018e34ce47dd9734ed64d (patch) | |
tree | 01017b7a2ef6ca277aaf37e356cf0d83d3371152 /ppapi/proxy/media_stream_video_track_resource.cc | |
parent | eb7350d046524fbe069e1e320f49546693475a3f (diff) | |
download | chromium_src-5294ec9616595ec4691018e34ce47dd9734ed64d.zip chromium_src-5294ec9616595ec4691018e34ce47dd9734ed64d.tar.gz chromium_src-5294ec9616595ec4691018e34ce47dd9734ed64d.tar.bz2 |
[PPAPI] Add media stream video track output API
Implemented the pepper host for the output mode.
R=bbudge@chromium.org, dmichael@chromium.org, jschuh@chromium.org, yzshen@chromium.org
Review URL: https://codereview.chromium.org/145263008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@268318 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/proxy/media_stream_video_track_resource.cc')
-rw-r--r-- | ppapi/proxy/media_stream_video_track_resource.cc | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/ppapi/proxy/media_stream_video_track_resource.cc b/ppapi/proxy/media_stream_video_track_resource.cc index aaa5b52..fc602311 100644 --- a/ppapi/proxy/media_stream_video_track_resource.cc +++ b/ppapi/proxy/media_stream_video_track_resource.cc @@ -24,6 +24,14 @@ MediaStreamVideoTrackResource::MediaStreamVideoTrackResource( get_frame_output_(NULL) { } +MediaStreamVideoTrackResource::MediaStreamVideoTrackResource( + Connection connection, + PP_Instance instance) + : MediaStreamTrackResourceBase(connection, instance), + get_frame_output_(NULL) { + SendCreate(RENDERER, PpapiHostMsg_MediaStreamVideoTrack_Create()); +} + MediaStreamVideoTrackResource::~MediaStreamVideoTrackResource() { Close(); } @@ -150,6 +158,17 @@ void MediaStreamVideoTrackResource::Close() { MediaStreamTrackResourceBase::CloseInternal(); } +int32_t MediaStreamVideoTrackResource::GetEmptyFrame( + PP_Resource* frame, scoped_refptr<TrackedCallback> callback) { + return GetFrame(frame, callback); +} + +int32_t MediaStreamVideoTrackResource::PutFrame(PP_Resource frame) { + // TODO(ronghuawu): Consider to rename RecycleFrame to PutFrame and use + // one set of GetFrame and PutFrame for both input and output. + return RecycleFrame(frame); +} + void MediaStreamVideoTrackResource::OnNewBufferEnqueued() { if (!TrackedCallback::IsPending(get_frame_callback_)) return; @@ -189,7 +208,13 @@ void MediaStreamVideoTrackResource::ReleaseFrames() { } void MediaStreamVideoTrackResource::OnPluginMsgConfigureReply( - const ResourceMessageReplyParams& params) { + const ResourceMessageReplyParams& params, + const std::string& track_id) { + if (id().empty()) { + set_id(track_id); + } else { + DCHECK_EQ(id(), track_id); + } if (TrackedCallback::IsPending(configure_callback_)) { scoped_refptr<TrackedCallback> callback; callback.swap(configure_callback_); |