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 PPAPI_PROXY_EXPORT VideoFrameResource : public Resource, | |
19 public thunk::PPB_VideoFrame_API { | |
20 public: | |
21 VideoFrameResource(PP_Instance instance, | |
22 int32_t index, | |
23 MediaStreamFrame::Video* frame); | |
24 virtual ~VideoFrameResource(); | |
25 | |
26 int32_t index() const { return index_; } | |
27 | |
28 MediaStreamFrame::Video* video_frame() const { return frame_; } | |
29 | |
30 void invalidate() { | |
31 frame_ = NULL; | |
32 index_ = -1; | |
33 } | |
bbudge
2014/01/13 20:03:52
Sorry if I wasn't very clear before. I was thinkin
Peng
2014/01/13 20:26:55
Oops! I misunderstood your comment.
I would like
bbudge
2014/01/13 20:52:44
Is it that important that the constructor be priva
Peng
2014/01/14 15:55:55
Done.
| |
34 | |
35 | |
36 // PluginResource overrides: | |
37 virtual thunk::PPB_VideoFrame_API* AsPPB_VideoFrame_API() OVERRIDE; | |
38 | |
39 // PPB_VideoFrame_API overrides: | |
40 virtual PP_TimeDelta GetTimestamp() OVERRIDE; | |
41 virtual void SetTimestamp(PP_TimeDelta timestamp) OVERRIDE; | |
42 virtual PP_VideoFrame_Format GetFormat() OVERRIDE; | |
43 virtual PP_Bool GetSize(PP_Size* size) OVERRIDE; | |
44 virtual void* GetDataBuffer() OVERRIDE; | |
45 virtual uint32_t GetDataBufferSize() OVERRIDE; | |
46 | |
47 private: | |
48 // Frame index | |
49 int32_t index_; | |
50 | |
51 MediaStreamFrame::Video* frame_; | |
52 | |
53 DISALLOW_COPY_AND_ASSIGN(VideoFrameResource); | |
54 }; | |
55 | |
56 } // namespace proxy | |
57 } // namespace ppapi | |
58 | |
59 #endif // PPAPI_PROXY_VIDEO_FRAME_RESOURCE_H_ | |
OLD | NEW |