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_IMPL_H_ | 5 #ifndef MEDIA_CAST_SENDER_VIDEO_ENCODER_IMPL_H_ |
6 #define MEDIA_CAST_SENDER_VIDEO_ENCODER_IMPL_H_ | 6 #define MEDIA_CAST_SENDER_VIDEO_ENCODER_IMPL_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "media/cast/cast_config.h" | 9 #include "media/cast/cast_config.h" |
10 #include "media/cast/cast_environment.h" | 10 #include "media/cast/cast_environment.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 ~VideoEncoderImpl() override; | 35 ~VideoEncoderImpl() override; |
36 | 36 |
37 // VideoEncoder implementation. | 37 // VideoEncoder implementation. |
38 bool EncodeVideoFrame( | 38 bool EncodeVideoFrame( |
39 const scoped_refptr<media::VideoFrame>& video_frame, | 39 const scoped_refptr<media::VideoFrame>& video_frame, |
40 const base::TimeTicks& reference_time, | 40 const base::TimeTicks& reference_time, |
41 const FrameEncodedCallback& frame_encoded_callback) override; | 41 const FrameEncodedCallback& frame_encoded_callback) override; |
42 void SetBitRate(int new_bit_rate) override; | 42 void SetBitRate(int new_bit_rate) override; |
43 void GenerateKeyFrame() override; | 43 void GenerateKeyFrame() override; |
44 void LatestFrameIdToReference(uint32 frame_id) override; | 44 void LatestFrameIdToReference(uint32 frame_id) override; |
| 45 scoped_refptr<VideoFrameFactory> GetVideoFrameFactory() override; |
45 | 46 |
46 private: | 47 private: |
47 scoped_refptr<CastEnvironment> cast_environment_; | 48 scoped_refptr<CastEnvironment> cast_environment_; |
48 CodecDynamicConfig dynamic_config_; | 49 CodecDynamicConfig dynamic_config_; |
49 | 50 |
50 // This member belongs to the video encoder thread. It must not be | 51 // This member belongs to the video encoder thread. It must not be |
51 // dereferenced on the main thread. We manage the lifetime of this member | 52 // dereferenced on the main thread. We manage the lifetime of this member |
52 // manually because it needs to be initialize, used and destroyed on the | 53 // manually because it needs to be initialize, used and destroyed on the |
53 // video encoder thread and video encoder thread can out-live the main thread. | 54 // video encoder thread and video encoder thread can out-live the main thread. |
54 scoped_ptr<SoftwareVideoEncoder> encoder_; | 55 scoped_ptr<SoftwareVideoEncoder> encoder_; |
55 | 56 |
56 DISALLOW_COPY_AND_ASSIGN(VideoEncoderImpl); | 57 DISALLOW_COPY_AND_ASSIGN(VideoEncoderImpl); |
57 }; | 58 }; |
58 | 59 |
59 } // namespace cast | 60 } // namespace cast |
60 } // namespace media | 61 } // namespace media |
61 | 62 |
62 #endif // MEDIA_CAST_SENDER_VIDEO_ENCODER_IMPL_H_ | 63 #endif // MEDIA_CAST_SENDER_VIDEO_ENCODER_IMPL_H_ |
OLD | NEW |