OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef PPAPI_PROXY_MEDIA_STREAM_VIDEO_TRACK_RESOURCE_H_ | 5 #ifndef PPAPI_PROXY_MEDIA_STREAM_VIDEO_TRACK_RESOURCE_H_ |
6 #define PPAPI_PROXY_MEDIA_STREAM_VIDEO_TRACK_RESOURCE_H_ | 6 #define PPAPI_PROXY_MEDIA_STREAM_VIDEO_TRACK_RESOURCE_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 virtual PP_Var GetId() OVERRIDE; | 36 virtual PP_Var GetId() OVERRIDE; |
37 virtual PP_Bool HasEnded() OVERRIDE; | 37 virtual PP_Bool HasEnded() OVERRIDE; |
38 virtual int32_t Configure(uint32_t max_buffered_frames) OVERRIDE; | 38 virtual int32_t Configure(uint32_t max_buffered_frames) OVERRIDE; |
39 virtual int32_t GetFrame( | 39 virtual int32_t GetFrame( |
40 PP_Resource* frame, | 40 PP_Resource* frame, |
41 scoped_refptr<TrackedCallback> callback) OVERRIDE; | 41 scoped_refptr<TrackedCallback> callback) OVERRIDE; |
42 virtual int32_t RecycleFrame(PP_Resource frame) OVERRIDE; | 42 virtual int32_t RecycleFrame(PP_Resource frame) OVERRIDE; |
43 virtual void Close() OVERRIDE; | 43 virtual void Close() OVERRIDE; |
44 | 44 |
45 // MediaStreamFrameBuffer::Delegate overrides: | 45 // MediaStreamFrameBuffer::Delegate overrides: |
46 virtual void OnNewFrameEnqueued() OVERRIDE; | 46 virtual bool OnNewFramePreEnqueued(int32_t index) OVERRIDE; |
47 | 47 |
48 private: | 48 private: |
49 PP_Resource GetVideoFrame(); | 49 PP_Resource GetVideoFrame(int32_t index); |
50 | 50 |
51 void ReleaseFrames(); | 51 void ReleaseFrames(); |
52 | 52 |
53 // Allocated frame resources by |GetFrame()|. | 53 // Allocated frame resources by |GetFrame()|. |
54 typedef std::map<PP_Resource, scoped_refptr<VideoFrameResource> > FrameMap; | 54 typedef std::map<PP_Resource, scoped_refptr<VideoFrameResource> > FrameMap; |
55 FrameMap frames_; | 55 FrameMap frames_; |
56 | 56 |
57 PP_Resource* get_frame_output_; | 57 PP_Resource* get_frame_output_; |
58 | 58 |
59 scoped_refptr<TrackedCallback> get_frame_callback_; | 59 scoped_refptr<TrackedCallback> get_frame_callback_; |
60 | 60 |
61 DISALLOW_COPY_AND_ASSIGN(MediaStreamVideoTrackResource); | 61 DISALLOW_COPY_AND_ASSIGN(MediaStreamVideoTrackResource); |
62 }; | 62 }; |
63 | 63 |
64 } // namespace proxy | 64 } // namespace proxy |
65 } // namespace ppapi | 65 } // namespace ppapi |
66 | 66 |
67 #endif // PPAPI_PROXY_MEDIA_STREAM_VIDEO_TRACK_RESOURCE_H_ | 67 #endif // PPAPI_PROXY_MEDIA_STREAM_VIDEO_TRACK_RESOURCE_H_ |
OLD | NEW |