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

Side by Side Diff: content/renderer/pepper/pepper_media_stream_track_host_base.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: Fix review issues 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright (c) 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_RENDERER_PEPPER_PEPPER_MEDIA_STREAM_TRACK_HOST_BASE_H_
6 #define CONTENT_RENDERER_PEPPER_PEPPER_MEDIA_STREAM_TRACK_HOST_BASE_H_
7
8 #include "base/compiler_specific.h"
9 #include "content/common/content_export.h"
10 #include "ppapi/host/resource_host.h"
11 #include "ppapi/shared_impl/media_stream_frame_buffer.h"
12
13 namespace content {
14
15 class RendererPpapiHost;
16
17 class PepperMediaStreamTrackHostBase
18 : public ppapi::host::ResourceHost,
19 public ppapi::MediaStreamFrameBuffer::Delegate {
20 protected:
21 PepperMediaStreamTrackHostBase(RendererPpapiHost* host,
22 PP_Instance instance,
23 PP_Resource resource);
24 virtual ~PepperMediaStreamTrackHostBase();
25
26 bool InitFrames(int32_t number_of_frames, int32_t frame_size);
27
28 ppapi::MediaStreamFrameBuffer* frame_buffer() { return &frame_buffer_; }
29
30 // Sends a frame index to the corresponding MediaStreamTrackResourceBase
31 // via an IPC message. The resource adds the frame index into its
32 // |frame_buffer_| for reading or writing. Also see |MediaStreamFrameBuffer|.
33 void SendEnqueueFrameMessageToPlugin(int32_t index);
dmichael (off chromium) 2014/01/13 21:26:47 Thanks, this is better. Another possibility might
Peng 2014/01/14 15:55:55 In this CL, it is used for sending a ready frame t
dmichael (off chromium) 2014/01/14 16:12:03 Sure, makes sense. I think the longer name you're
34
35 // Subclasses must implement this method to clean up when the track is closed.
36 virtual void OnClose() = 0;
dmichael (off chromium) 2014/01/13 21:26:47 (Without checking, I would expect OnClose to come
Peng 2014/01/14 15:55:55 Done.
37
38 private:
39 // ResourceMessageHandler overrides:
40 virtual int32_t OnResourceMessageReceived(
41 const IPC::Message& msg,
42 ppapi::host::HostMessageContext* context) OVERRIDE;
43
44 // Message handlers:
45 int32_t OnHostMsgEnqueueFrame(ppapi::host::HostMessageContext* context,
46 int32_t index);
47 int32_t OnHostMsgClose(ppapi::host::HostMessageContext* context);
48
49 RendererPpapiHost* host_;
50
51 ppapi::MediaStreamFrameBuffer frame_buffer_;
52
53 DISALLOW_COPY_AND_ASSIGN(PepperMediaStreamTrackHostBase);
54 };
55
56 } // namespace content
57
58 #endif // CONTENT_RENDERER_PEPPER_PEPPER_MEDIA_STREAM_TRACK_HOST_BASE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698