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_EXTERNAL_VIDEO_ENCODER_H_ | 5 #ifndef MEDIA_CAST_SENDER_EXTERNAL_VIDEO_ENCODER_H_ |
6 #define MEDIA_CAST_SENDER_EXTERNAL_VIDEO_ENCODER_H_ | 6 #define MEDIA_CAST_SENDER_EXTERNAL_VIDEO_ENCODER_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "media/cast/cast_config.h" | 10 #include "media/cast/cast_config.h" |
(...skipping 26 matching lines...) Expand all Loading... |
37 // Called from the main cast thread. This function post the encode task to the | 37 // Called from the main cast thread. This function post the encode task to the |
38 // video encoder thread; | 38 // video encoder thread; |
39 // The video_frame must be valid until the closure callback is called. | 39 // The video_frame must be valid until the closure callback is called. |
40 // The closure callback is called from the video encoder thread as soon as | 40 // The closure callback is called from the video encoder thread as soon as |
41 // the encoder is done with the frame; it does not mean that the encoded frame | 41 // the encoder is done with the frame; it does not mean that the encoded frame |
42 // has been sent out. | 42 // has been sent out. |
43 // Once the encoded frame is ready the frame_encoded_callback is called. | 43 // Once the encoded frame is ready the frame_encoded_callback is called. |
44 virtual bool EncodeVideoFrame( | 44 virtual bool EncodeVideoFrame( |
45 const scoped_refptr<media::VideoFrame>& video_frame, | 45 const scoped_refptr<media::VideoFrame>& video_frame, |
46 const base::TimeTicks& capture_time, | 46 const base::TimeTicks& capture_time, |
47 const FrameEncodedCallback& frame_encoded_callback) OVERRIDE; | 47 const FrameEncodedCallback& frame_encoded_callback) override; |
48 | 48 |
49 // The following functions are called from the main cast thread. | 49 // The following functions are called from the main cast thread. |
50 virtual void SetBitRate(int new_bit_rate) OVERRIDE; | 50 virtual void SetBitRate(int new_bit_rate) override; |
51 virtual void GenerateKeyFrame() OVERRIDE; | 51 virtual void GenerateKeyFrame() override; |
52 virtual void LatestFrameIdToReference(uint32 frame_id) OVERRIDE; | 52 virtual void LatestFrameIdToReference(uint32 frame_id) override; |
53 | 53 |
54 // Called when video_accelerator_client_ has finished creating the VEA and | 54 // Called when video_accelerator_client_ has finished creating the VEA and |
55 // is ready for use. | 55 // is ready for use. |
56 void OnCreateVideoEncodeAccelerator( | 56 void OnCreateVideoEncodeAccelerator( |
57 scoped_refptr<base::SingleThreadTaskRunner> encoder_task_runner); | 57 scoped_refptr<base::SingleThreadTaskRunner> encoder_task_runner); |
58 | 58 |
59 protected: | 59 protected: |
60 // If |success| is true then encoder is initialized successfully. | 60 // If |success| is true then encoder is initialized successfully. |
61 // Otherwise encoder initialization failed. | 61 // Otherwise encoder initialization failed. |
62 void EncoderInitialized(bool success); | 62 void EncoderInitialized(bool success); |
(...skipping 18 matching lines...) Expand all Loading... |
81 // NOTE: Weak pointers must be invalidated before all other member variables. | 81 // NOTE: Weak pointers must be invalidated before all other member variables. |
82 base::WeakPtrFactory<ExternalVideoEncoder> weak_factory_; | 82 base::WeakPtrFactory<ExternalVideoEncoder> weak_factory_; |
83 | 83 |
84 DISALLOW_COPY_AND_ASSIGN(ExternalVideoEncoder); | 84 DISALLOW_COPY_AND_ASSIGN(ExternalVideoEncoder); |
85 }; | 85 }; |
86 | 86 |
87 } // namespace cast | 87 } // namespace cast |
88 } // namespace media | 88 } // namespace media |
89 | 89 |
90 #endif // MEDIA_CAST_SENDER_EXTERNAL_VIDEO_ENCODER_H_ | 90 #endif // MEDIA_CAST_SENDER_EXTERNAL_VIDEO_ENCODER_H_ |
OLD | NEW |