| Index: media/cast/sender/h264_vt_encoder.cc
|
| diff --git a/media/cast/sender/h264_vt_encoder.cc b/media/cast/sender/h264_vt_encoder.cc
|
| index 5e253ed26b968d67c1e9a44b34e30d731632f384..0f6a4f3513adc9db016882a45228ab6aa908a377 100644
|
| --- a/media/cast/sender/h264_vt_encoder.cc
|
| +++ b/media/cast/sender/h264_vt_encoder.cc
|
| @@ -335,6 +335,11 @@ void H264VideoToolboxEncoder::ConfigureSession(
|
| SetSessionProperty(
|
| videotoolbox_glue_->kVTCompressionPropertyKey_YCbCrMatrix(),
|
| kCVImageBufferYCbCrMatrix_ITU_R_709_2);
|
| + if (video_config.max_number_of_video_buffers_used > 0) {
|
| + SetSessionProperty(
|
| + videotoolbox_glue_->kVTCompressionPropertyKey_MaxFrameDelayCount(),
|
| + video_config.max_number_of_video_buffers_used);
|
| + }
|
| }
|
|
|
| void H264VideoToolboxEncoder::Teardown() {
|
| @@ -430,6 +435,21 @@ H264VideoToolboxEncoder::CreateVideoFrameFactory() {
|
| new VideoFrameFactoryCVPixelBufferPoolImpl(pool));
|
| }
|
|
|
| +void H264VideoToolboxEncoder::EmitFrames() {
|
| + DCHECK(thread_checker_.CalledOnValidThread());
|
| +
|
| + if (!compression_session_) {
|
| + DLOG(ERROR) << " compression session is null";
|
| + return;
|
| + }
|
| +
|
| + OSStatus status = videotoolbox_glue_->VTCompressionSessionCompleteFrames(
|
| + compression_session_, CoreMediaGlue::CMTime{0, 0, 0, 0});
|
| + if (status != noErr) {
|
| + DLOG(ERROR) << " VTCompressionSessionCompleteFrames failed: " << status;
|
| + }
|
| +}
|
| +
|
| bool H264VideoToolboxEncoder::SetSessionProperty(CFStringRef key,
|
| int32_t value) {
|
| base::ScopedCFTypeRef<CFNumberRef> cfvalue(
|
|
|