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

Unified Diff: content/renderer/pepper/pepper_media_stream_video_track_host.h

Issue 128683003: [PPAPI] Implement media stream video track API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@video_track_impl_cl
Patch Set: Rebase it Created 6 years, 11 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/pepper/pepper_media_stream_video_track_host.h
diff --git a/content/renderer/pepper/pepper_media_stream_video_track_host.h b/content/renderer/pepper/pepper_media_stream_video_track_host.h
new file mode 100644
index 0000000000000000000000000000000000000000..c270718eda384db2ace2a64b93d9ddc6a6d3eb21
--- /dev/null
+++ b/content/renderer/pepper/pepper_media_stream_video_track_host.h
@@ -0,0 +1,58 @@
+// Copyright (c) 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_RENDERER_PEPPER_PEPPER_MEDIA_STREAM_VIDEO_TRACK_HOST_H_
+#define CONTENT_RENDERER_PEPPER_PEPPER_MEDIA_STREAM_VIDEO_TRACK_HOST_H_
+
+#include "base/compiler_specific.h"
+#include "content/public/renderer/media_stream_video_sink.h"
+#include "content/renderer/pepper/pepper_media_stream_track_host_base.h"
+#include "media/base/video_frame.h"
+#include "third_party/WebKit/public/platform/WebMediaStreamTrack.h"
+#include "ui/gfx/size.h"
+
+namespace content {
+
+class PepperMediaStreamVideoTrackHost :
+ public PepperMediaStreamTrackHostBase,
+ public MediaStreamVideoSink {
+ public:
+ PepperMediaStreamVideoTrackHost(RendererPpapiHost* host,
+ PP_Instance instance,
+ PP_Resource resource,
+ const blink::WebMediaStreamTrack& track);
+
+ virtual ~PepperMediaStreamVideoTrackHost();
+
+ // PepperMediaStreamTrackHostBase overrides:
+ virtual void OnClose() OVERRIDE;
+
+ // MediaStreamVideoSink overrides:
+ virtual void OnVideoFrame(
+ const scoped_refptr<media::VideoFrame>& frame) OVERRIDE;
+
+ protected:
+ virtual void DidConnectPendingHostToResource() OVERRIDE;
dmichael (off chromium) 2014/01/09 21:06:47 nit: I think all the virtual functions could be pr
Peng 2014/01/10 19:14:30 Done.
+
+ private:
+ blink::WebMediaStreamTrack track_;
+
+ // True if it has been added to |blink::WebMediaStreamTrack| as a sink.
+ bool connected_;
+
+ // Frame size in pixels.
+ gfx::Size frame_size_;
dmichael (off chromium) 2014/01/09 21:06:47 I found this name slightly confusing. It might be
Peng 2014/01/10 19:14:30 No. It is a gfx::Size. I mean the width and height
dmichael (off chromium) 2014/01/13 21:26:47 Okay, sorry for my misunderstanding. I think the p
+
+ // Frame format.
+ media::VideoFrame::Format frame_format_;
+
+ // The size of frame pixels in bytes.
+ uint32_t frame_data_size_;
+
+ DISALLOW_COPY_AND_ASSIGN(PepperMediaStreamVideoTrackHost);
+};
+
+} // namespace content
+
+#endif // CONTENT_RENDERER_PEPPER_PEPPER_MEDIA_STREAM_VIDEO_TRACK_HOST_H_

Powered by Google App Engine
This is Rietveld 408576698