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 MEDIA_CAST_SENDER_VIDEO_ENCODER_H_ | 5 #ifndef MEDIA_CAST_SENDER_VIDEO_ENCODER_H_ |
6 #define MEDIA_CAST_SENDER_VIDEO_ENCODER_H_ | 6 #define MEDIA_CAST_SENDER_VIDEO_ENCODER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 // the current platform's hardware/library support; or null if no | 31 // the current platform's hardware/library support; or null if no |
32 // implementation will suffice. The instance will run |status_change_cb| at | 32 // implementation will suffice. The instance will run |status_change_cb| at |
33 // some point in the future to indicate initialization success/failure. | 33 // some point in the future to indicate initialization success/failure. |
34 // | 34 // |
35 // All VideoEncoder instances returned by this function support encoding | 35 // All VideoEncoder instances returned by this function support encoding |
36 // sequences of differently-size VideoFrames. | 36 // sequences of differently-size VideoFrames. |
37 // | 37 // |
38 // TODO(miu): Remove the CreateVEA callbacks. http://crbug.com/454029 | 38 // TODO(miu): Remove the CreateVEA callbacks. http://crbug.com/454029 |
39 static std::unique_ptr<VideoEncoder> Create( | 39 static std::unique_ptr<VideoEncoder> Create( |
40 const scoped_refptr<CastEnvironment>& cast_environment, | 40 const scoped_refptr<CastEnvironment>& cast_environment, |
41 const VideoSenderConfig& video_config, | 41 const FrameSenderConfig& video_config, |
42 const StatusChangeCallback& status_change_cb, | 42 const StatusChangeCallback& status_change_cb, |
43 const CreateVideoEncodeAcceleratorCallback& create_vea_cb, | 43 const CreateVideoEncodeAcceleratorCallback& create_vea_cb, |
44 const CreateVideoEncodeMemoryCallback& create_video_encode_memory_cb); | 44 const CreateVideoEncodeMemoryCallback& create_video_encode_memory_cb); |
45 | 45 |
46 virtual ~VideoEncoder() {} | 46 virtual ~VideoEncoder() {} |
47 | 47 |
48 // If true is returned, the Encoder has accepted the request and will process | 48 // If true is returned, the Encoder has accepted the request and will process |
49 // it asynchronously, running |frame_encoded_callback| on the MAIN | 49 // it asynchronously, running |frame_encoded_callback| on the MAIN |
50 // CastEnvironment thread with the result. If false is returned, nothing | 50 // CastEnvironment thread with the result. If false is returned, nothing |
51 // happens and the callback will not be run. | 51 // happens and the callback will not be run. |
(...skipping 19 matching lines...) Expand all Loading... |
71 // network congestion, it is necessary to flush out of the encoder all | 71 // network congestion, it is necessary to flush out of the encoder all |
72 // submitted frames so that eventually new frames may be encoded. Like | 72 // submitted frames so that eventually new frames may be encoded. Like |
73 // EncodeVideoFrame(), the encoder will process this request asynchronously. | 73 // EncodeVideoFrame(), the encoder will process this request asynchronously. |
74 virtual void EmitFrames(); | 74 virtual void EmitFrames(); |
75 }; | 75 }; |
76 | 76 |
77 } // namespace cast | 77 } // namespace cast |
78 } // namespace media | 78 } // namespace media |
79 | 79 |
80 #endif // MEDIA_CAST_SENDER_VIDEO_ENCODER_H_ | 80 #endif // MEDIA_CAST_SENDER_VIDEO_ENCODER_H_ |
OLD | NEW |