Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(171)

Side by Side Diff: media/cast/sender/h264_vt_encoder.cc

Issue 892383002: RELAND: [Cast] Software encoder support for varying video frame sizes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix for 'access to uninitialized memory' error. Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « media/cast/sender/h264_vt_encoder.h ('k') | media/cast/sender/video_encoder.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #include "media/cast/sender/h264_vt_encoder.h" 5 #include "media/cast/sender/h264_vt_encoder.h"
6 6
7 #include <string> 7 #include <string>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/big_endian.h" 10 #include "base/big_endian.h"
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 354
355 // If the compression session exists, invalidate it. This blocks until all 355 // If the compression session exists, invalidate it. This blocks until all
356 // pending output callbacks have returned and any internal threads have 356 // pending output callbacks have returned and any internal threads have
357 // joined, ensuring no output callback ever sees a dangling encoder pointer. 357 // joined, ensuring no output callback ever sees a dangling encoder pointer.
358 if (compression_session_) { 358 if (compression_session_) {
359 videotoolbox_glue_->VTCompressionSessionInvalidate(compression_session_); 359 videotoolbox_glue_->VTCompressionSessionInvalidate(compression_session_);
360 compression_session_.reset(); 360 compression_session_.reset();
361 } 361 }
362 } 362 }
363 363
364 bool H264VideoToolboxEncoder::CanEncodeVariedFrameSizes() const {
365 return false;
366 }
367
364 bool H264VideoToolboxEncoder::EncodeVideoFrame( 368 bool H264VideoToolboxEncoder::EncodeVideoFrame(
365 const scoped_refptr<media::VideoFrame>& video_frame, 369 const scoped_refptr<media::VideoFrame>& video_frame,
366 const base::TimeTicks& reference_time, 370 const base::TimeTicks& reference_time,
367 const FrameEncodedCallback& frame_encoded_callback) { 371 const FrameEncodedCallback& frame_encoded_callback) {
368 DCHECK(thread_checker_.CalledOnValidThread()); 372 DCHECK(thread_checker_.CalledOnValidThread());
369 DCHECK(!video_frame->visible_rect().IsEmpty()); 373 DCHECK(!video_frame->visible_rect().IsEmpty());
370 DCHECK(!frame_encoded_callback.is_null()); 374 DCHECK(!frame_encoded_callback.is_null());
371 375
372 if (!compression_session_) { 376 if (!compression_session_) {
373 DLOG(ERROR) << " compression session is null"; 377 DLOG(ERROR) << " compression session is null";
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
533 CopySampleBufferToAnnexBBuffer(sbuf, &encoded_frame->data, keyframe); 537 CopySampleBufferToAnnexBBuffer(sbuf, &encoded_frame->data, keyframe);
534 538
535 encoder->cast_environment_->PostTask( 539 encoder->cast_environment_->PostTask(
536 CastEnvironment::MAIN, FROM_HERE, 540 CastEnvironment::MAIN, FROM_HERE,
537 base::Bind(request->frame_encoded_callback, 541 base::Bind(request->frame_encoded_callback,
538 base::Passed(&encoded_frame))); 542 base::Passed(&encoded_frame)));
539 } 543 }
540 544
541 } // namespace cast 545 } // namespace cast
542 } // namespace media 546 } // namespace media
OLDNEW
« no previous file with comments | « media/cast/sender/h264_vt_encoder.h ('k') | media/cast/sender/video_encoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698