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_CODECS_VP8_VP8_ENCODER_H_ | 5 #ifndef MEDIA_CAST_SENDER_CODECS_VP8_VP8_ENCODER_H_ |
6 #define MEDIA_CAST_SENDER_CODECS_VP8_VP8_ENCODER_H_ | 6 #define MEDIA_CAST_SENDER_CODECS_VP8_VP8_ENCODER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/threading/thread_checker.h" | 10 #include "base/threading/thread_checker.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 const int kNumberOfVp8VideoBuffers = 3; | 26 const int kNumberOfVp8VideoBuffers = 3; |
27 | 27 |
28 class Vp8Encoder : public SoftwareVideoEncoder { | 28 class Vp8Encoder : public SoftwareVideoEncoder { |
29 public: | 29 public: |
30 Vp8Encoder(const VideoSenderConfig& video_config, int max_unacked_frames); | 30 Vp8Encoder(const VideoSenderConfig& video_config, int max_unacked_frames); |
31 | 31 |
32 virtual ~Vp8Encoder(); | 32 virtual ~Vp8Encoder(); |
33 | 33 |
34 // Initialize the encoder before Encode() can be called. This method | 34 // Initialize the encoder before Encode() can be called. This method |
35 // must be called on the thread that Encode() is called. | 35 // must be called on the thread that Encode() is called. |
36 virtual void Initialize() OVERRIDE; | 36 virtual void Initialize() override; |
37 | 37 |
38 // Encode a raw image (as a part of a video stream). | 38 // Encode a raw image (as a part of a video stream). |
39 virtual bool Encode(const scoped_refptr<media::VideoFrame>& video_frame, | 39 virtual bool Encode(const scoped_refptr<media::VideoFrame>& video_frame, |
40 EncodedFrame* encoded_image) OVERRIDE; | 40 EncodedFrame* encoded_image) override; |
41 | 41 |
42 // Update the encoder with a new target bit rate. | 42 // Update the encoder with a new target bit rate. |
43 virtual void UpdateRates(uint32 new_bitrate) OVERRIDE; | 43 virtual void UpdateRates(uint32 new_bitrate) override; |
44 | 44 |
45 // Set the next frame to be a key frame. | 45 // Set the next frame to be a key frame. |
46 virtual void GenerateKeyFrame() OVERRIDE; | 46 virtual void GenerateKeyFrame() override; |
47 | 47 |
48 virtual void LatestFrameIdToReference(uint32 frame_id) OVERRIDE; | 48 virtual void LatestFrameIdToReference(uint32 frame_id) override; |
49 | 49 |
50 private: | 50 private: |
51 enum Vp8Buffers { | 51 enum Vp8Buffers { |
52 kAltRefBuffer = 0, | 52 kAltRefBuffer = 0, |
53 kGoldenBuffer = 1, | 53 kGoldenBuffer = 1, |
54 kLastBuffer = 2, | 54 kLastBuffer = 2, |
55 kNoBuffer = 3 // Note: must be last. | 55 kNoBuffer = 3 // Note: must be last. |
56 }; | 56 }; |
57 | 57 |
58 enum Vp8BufferState { | 58 enum Vp8BufferState { |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 // This is bound to the thread where Initialize() is called. | 101 // This is bound to the thread where Initialize() is called. |
102 base::ThreadChecker thread_checker_; | 102 base::ThreadChecker thread_checker_; |
103 | 103 |
104 DISALLOW_COPY_AND_ASSIGN(Vp8Encoder); | 104 DISALLOW_COPY_AND_ASSIGN(Vp8Encoder); |
105 }; | 105 }; |
106 | 106 |
107 } // namespace cast | 107 } // namespace cast |
108 } // namespace media | 108 } // namespace media |
109 | 109 |
110 #endif // MEDIA_CAST_SENDER_CODECS_VP8_VP8_ENCODER_H_ | 110 #endif // MEDIA_CAST_SENDER_CODECS_VP8_VP8_ENCODER_H_ |
OLD | NEW |