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_H264_VT_ENCODER_H_ | 5 #ifndef MEDIA_CAST_SENDER_H264_VT_ENCODER_H_ |
6 #define MEDIA_CAST_SENDER_H264_VT_ENCODER_H_ | 6 #define MEDIA_CAST_SENDER_H264_VT_ENCODER_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/mac/scoped_cftyperef.h" | 10 #include "base/mac/scoped_cftyperef.h" |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 | 68 |
69 // Destroy the current compression session if any. Blocks until all pending | 69 // Destroy the current compression session if any. Blocks until all pending |
70 // frames have been flushed out (similar to EmitFrames without doing any | 70 // frames have been flushed out (similar to EmitFrames without doing any |
71 // encoding work). | 71 // encoding work). |
72 void DestroyCompressionSession(); | 72 void DestroyCompressionSession(); |
73 | 73 |
74 // Update the encoder's target frame size by resetting the compression | 74 // Update the encoder's target frame size by resetting the compression |
75 // session. This will also update the video frame factory. | 75 // session. This will also update the video frame factory. |
76 void UpdateFrameSize(const gfx::Size& size_needed); | 76 void UpdateFrameSize(const gfx::Size& size_needed); |
77 | 77 |
78 // Set a compression session property. | |
79 bool SetSessionProperty(CFStringRef key, int32_t value); | |
80 bool SetSessionProperty(CFStringRef key, bool value); | |
81 bool SetSessionProperty(CFStringRef key, CFStringRef value); | |
82 | |
83 // Compression session callback function to handle compressed frames. | 78 // Compression session callback function to handle compressed frames. |
84 static void CompressionCallback(void* encoder_opaque, | 79 static void CompressionCallback(void* encoder_opaque, |
85 void* request_opaque, | 80 void* request_opaque, |
86 OSStatus status, | 81 OSStatus status, |
87 VTEncodeInfoFlags info, | 82 VTEncodeInfoFlags info, |
88 CMSampleBufferRef sbuf); | 83 CMSampleBufferRef sbuf); |
89 | 84 |
90 // The cast environment (contains worker threads & more). | 85 // The cast environment (contains worker threads & more). |
91 const scoped_refptr<CastEnvironment> cast_environment_; | 86 const scoped_refptr<CastEnvironment> cast_environment_; |
92 | 87 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 // NOTE: Weak pointers must be invalidated before all other member variables. | 121 // NOTE: Weak pointers must be invalidated before all other member variables. |
127 base::WeakPtrFactory<H264VideoToolboxEncoder> weak_factory_; | 122 base::WeakPtrFactory<H264VideoToolboxEncoder> weak_factory_; |
128 | 123 |
129 DISALLOW_COPY_AND_ASSIGN(H264VideoToolboxEncoder); | 124 DISALLOW_COPY_AND_ASSIGN(H264VideoToolboxEncoder); |
130 }; | 125 }; |
131 | 126 |
132 } // namespace cast | 127 } // namespace cast |
133 } // namespace media | 128 } // namespace media |
134 | 129 |
135 #endif // MEDIA_CAST_SENDER_H264_VT_ENCODER_H_ | 130 #endif // MEDIA_CAST_SENDER_H264_VT_ENCODER_H_ |
OLD | NEW |