OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 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 PPAPI_PROXY_VIDEO_FRAME_RESOURCE_H_ | |
6 #define PPAPI_PROXY_VIDEO_FRAME_RESOURCE_H_ | |
7 | |
8 #include "base/basictypes.h" | |
9 #include "base/compiler_specific.h" | |
10 #include "ppapi/proxy/ppapi_proxy_export.h" | |
11 #include "ppapi/shared_impl/media_stream_frame.h" | |
12 #include "ppapi/shared_impl/resource.h" | |
13 #include "ppapi/thunk/ppb_video_frame_api.h" | |
14 | |
15 namespace ppapi { | |
16 namespace proxy { | |
17 | |
18 class MediaStreamVideoTrackResource; | |
19 | |
20 class PPAPI_PROXY_EXPORT VideoFrameResource : public Resource, | |
21 public thunk::PPB_VideoFrame_API { | |
22 public: | |
23 virtual ~VideoFrameResource(); | |
24 | |
25 // PluginResource overrides: | |
26 virtual thunk::PPB_VideoFrame_API* AsPPB_VideoFrame_API() OVERRIDE; | |
27 | |
28 // PPB_VideoFrame_API overrides: | |
29 virtual PP_TimeDelta GetTimestamp() OVERRIDE; | |
30 virtual void SetTimestamp(PP_TimeDelta timestamp) OVERRIDE; | |
31 virtual PP_VideoFrame_Format GetFormat() OVERRIDE; | |
32 virtual PP_Bool GetSize(PP_Size* size) OVERRIDE; | |
33 virtual void* GetDataBuffer() OVERRIDE; | |
34 virtual uint32_t GetDataBufferSize() OVERRIDE; | |
35 | |
36 private: | |
37 friend class MediaStreamVideoTrackResource; | |
bbudge
2014/01/10 22:57:06
If you add the needed methods to the API, you won'
Peng
2014/01/13 19:10:15
MediaStreamVideoTrackResource only needs below fou
| |
38 | |
39 VideoFrameResource(PP_Instance instance, | |
40 int32_t index, | |
41 MediaStreamFrame::Video* frame); | |
42 | |
43 int32_t index() const { return index_; } | |
44 | |
45 MediaStreamFrame::Video* video_frame() const { return frame_; } | |
46 | |
47 void invalidate() { | |
48 frame_ = NULL; | |
49 index_ = -1; | |
50 } | |
51 | |
52 // Frame index | |
53 int32_t index_; | |
54 | |
55 MediaStreamFrame::Video* frame_; | |
56 | |
57 DISALLOW_COPY_AND_ASSIGN(VideoFrameResource); | |
58 }; | |
59 | |
60 } // namespace proxy | |
61 } // namespace ppapi | |
62 | |
63 #endif // PPAPI_PROXY_VIDEO_FRAME_RESOURCE_H_ | |
OLD | NEW |