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 27 matching lines...) Expand all Loading... |
38 // Called from the main cast thread. This function post the encode task to the | 38 // Called from the main cast thread. This function post the encode task to the |
39 // video encoder thread; | 39 // video encoder thread; |
40 // The video_frame must be valid until the closure callback is called. | 40 // The video_frame must be valid until the closure callback is called. |
41 // The closure callback is called from the video encoder thread as soon as | 41 // The closure callback is called from the video encoder thread as soon as |
42 // the encoder is done with the frame; it does not mean that the encoded frame | 42 // the encoder is done with the frame; it does not mean that the encoded frame |
43 // has been sent out. | 43 // has been sent out. |
44 // Once the encoded frame is ready the frame_encoded_callback is called. | 44 // Once the encoded frame is ready the frame_encoded_callback is called. |
45 virtual bool EncodeVideoFrame( | 45 virtual bool EncodeVideoFrame( |
46 const scoped_refptr<media::VideoFrame>& video_frame, | 46 const scoped_refptr<media::VideoFrame>& video_frame, |
47 const base::TimeTicks& capture_time, | 47 const base::TimeTicks& capture_time, |
48 const FrameEncodedCallback& frame_encoded_callback) OVERRIDE; | 48 const FrameEncodedCallback& frame_encoded_callback) override; |
49 | 49 |
50 // The following functions are called from the main cast thread. | 50 // The following functions are called from the main cast thread. |
51 virtual void SetBitRate(int new_bit_rate) OVERRIDE; | 51 virtual void SetBitRate(int new_bit_rate) override; |
52 virtual void GenerateKeyFrame() OVERRIDE; | 52 virtual void GenerateKeyFrame() override; |
53 virtual void LatestFrameIdToReference(uint32 frame_id) OVERRIDE; | 53 virtual void LatestFrameIdToReference(uint32 frame_id) override; |
54 | 54 |
55 private: | 55 private: |
56 scoped_refptr<CastEnvironment> cast_environment_; | 56 scoped_refptr<CastEnvironment> cast_environment_; |
57 CodecDynamicConfig dynamic_config_; | 57 CodecDynamicConfig dynamic_config_; |
58 | 58 |
59 // This member belongs to the video encoder thread. It must not be | 59 // This member belongs to the video encoder thread. It must not be |
60 // dereferenced on the main thread. We manage the lifetime of this member | 60 // dereferenced on the main thread. We manage the lifetime of this member |
61 // manually because it needs to be initialize, used and destroyed on the | 61 // manually because it needs to be initialize, used and destroyed on the |
62 // video encoder thread and video encoder thread can out-live the main thread. | 62 // video encoder thread and video encoder thread can out-live the main thread. |
63 scoped_ptr<SoftwareVideoEncoder> encoder_; | 63 scoped_ptr<SoftwareVideoEncoder> encoder_; |
64 | 64 |
65 DISALLOW_COPY_AND_ASSIGN(VideoEncoderImpl); | 65 DISALLOW_COPY_AND_ASSIGN(VideoEncoderImpl); |
66 }; | 66 }; |
67 | 67 |
68 } // namespace cast | 68 } // namespace cast |
69 } // namespace media | 69 } // namespace media |
70 | 70 |
71 #endif // MEDIA_CAST_SENDER_VIDEO_ENCODER_IMPL_H_ | 71 #endif // MEDIA_CAST_SENDER_VIDEO_ENCODER_IMPL_H_ |
OLD | NEW |