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

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

Issue 899583002: Revert of [Cast] Software encoder support for varying video frame sizes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/fake_software_video_encoder.h ('k') | media/cast/sender/h264_vt_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/fake_software_video_encoder.h" 5 #include "media/cast/sender/fake_software_video_encoder.h"
6 6
7 #include "base/json/json_writer.h" 7 #include "base/json/json_writer.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "media/base/video_frame.h" 9 #include "media/base/video_frame.h"
10 #include "media/cast/net/cast_transport_config.h" 10 #include "media/cast/net/cast_transport_config.h"
(...skipping 15 matching lines...) Expand all
26 FakeSoftwareVideoEncoder::~FakeSoftwareVideoEncoder() {} 26 FakeSoftwareVideoEncoder::~FakeSoftwareVideoEncoder() {}
27 27
28 void FakeSoftwareVideoEncoder::Initialize() {} 28 void FakeSoftwareVideoEncoder::Initialize() {}
29 29
30 void FakeSoftwareVideoEncoder::Encode( 30 void FakeSoftwareVideoEncoder::Encode(
31 const scoped_refptr<media::VideoFrame>& video_frame, 31 const scoped_refptr<media::VideoFrame>& video_frame,
32 const base::TimeTicks& reference_time, 32 const base::TimeTicks& reference_time,
33 EncodedFrame* encoded_frame) { 33 EncodedFrame* encoded_frame) {
34 DCHECK(encoded_frame); 34 DCHECK(encoded_frame);
35 35
36 if (video_frame->visible_rect().size() != last_frame_size_) {
37 next_frame_is_key_ = true;
38 last_frame_size_ = video_frame->visible_rect().size();
39 }
40
41 encoded_frame->frame_id = frame_id_++; 36 encoded_frame->frame_id = frame_id_++;
42 if (next_frame_is_key_) { 37 if (next_frame_is_key_) {
43 encoded_frame->dependency = EncodedFrame::KEY; 38 encoded_frame->dependency = EncodedFrame::KEY;
44 encoded_frame->referenced_frame_id = encoded_frame->frame_id; 39 encoded_frame->referenced_frame_id = encoded_frame->frame_id;
45 next_frame_is_key_ = false; 40 next_frame_is_key_ = false;
46 } else { 41 } else {
47 encoded_frame->dependency = EncodedFrame::DEPENDENT; 42 encoded_frame->dependency = EncodedFrame::DEPENDENT;
48 encoded_frame->referenced_frame_id = encoded_frame->frame_id - 1; 43 encoded_frame->referenced_frame_id = encoded_frame->frame_id - 1;
49 } 44 }
50 encoded_frame->rtp_timestamp = 45 encoded_frame->rtp_timestamp =
(...skipping 20 matching lines...) Expand all
71 } 66 }
72 67
73 void FakeSoftwareVideoEncoder::LatestFrameIdToReference(uint32 frame_id) { 68 void FakeSoftwareVideoEncoder::LatestFrameIdToReference(uint32 frame_id) {
74 frame_id_to_reference_ = frame_id; 69 frame_id_to_reference_ = frame_id;
75 } 70 }
76 71
77 } // namespace cast 72 } // namespace cast
78 } // namespace media 73 } // namespace media
79 74
80 #endif 75 #endif
OLDNEW
« no previous file with comments | « media/cast/sender/fake_software_video_encoder.h ('k') | media/cast/sender/h264_vt_encoder.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698