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

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

Issue 1515433002: Replace uses of raw uint32's with a type-checked RtpTimeTicks data type. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Speculative workaround fix for win8_chromium_ng compile error. Created 4 years, 11 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/external_video_encoder.cc ('k') | media/cast/sender/frame_sender.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 <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/json/json_writer.h" 9 #include "base/json/json_writer.h"
10 #include "base/values.h" 10 #include "base/values.h"
11 #include "media/base/video_frame.h" 11 #include "media/base/video_frame.h"
12 #include "media/cast/cast_defines.h" 12 #include "media/cast/common/rtp_time.h"
13 #include "media/cast/constants.h" 13 #include "media/cast/constants.h"
14 14
15 #ifndef OFFICIAL_BUILD 15 #ifndef OFFICIAL_BUILD
16 16
17 namespace media { 17 namespace media {
18 namespace cast { 18 namespace cast {
19 19
20 FakeSoftwareVideoEncoder::FakeSoftwareVideoEncoder( 20 FakeSoftwareVideoEncoder::FakeSoftwareVideoEncoder(
21 const VideoSenderConfig& video_config) 21 const VideoSenderConfig& video_config)
22 : video_config_(video_config), 22 : video_config_(video_config),
(...skipping 20 matching lines...) Expand all
43 encoded_frame->frame_id = frame_id_++; 43 encoded_frame->frame_id = frame_id_++;
44 if (next_frame_is_key_) { 44 if (next_frame_is_key_) {
45 encoded_frame->dependency = EncodedFrame::KEY; 45 encoded_frame->dependency = EncodedFrame::KEY;
46 encoded_frame->referenced_frame_id = encoded_frame->frame_id; 46 encoded_frame->referenced_frame_id = encoded_frame->frame_id;
47 next_frame_is_key_ = false; 47 next_frame_is_key_ = false;
48 } else { 48 } else {
49 encoded_frame->dependency = EncodedFrame::DEPENDENT; 49 encoded_frame->dependency = EncodedFrame::DEPENDENT;
50 encoded_frame->referenced_frame_id = encoded_frame->frame_id - 1; 50 encoded_frame->referenced_frame_id = encoded_frame->frame_id - 1;
51 } 51 }
52 encoded_frame->rtp_timestamp = 52 encoded_frame->rtp_timestamp =
53 TimeDeltaToRtpDelta(video_frame->timestamp(), kVideoFrequency); 53 RtpTimeTicks::FromTimeDelta(video_frame->timestamp(), kVideoFrequency);
54 encoded_frame->reference_time = reference_time; 54 encoded_frame->reference_time = reference_time;
55 55
56 base::DictionaryValue values; 56 base::DictionaryValue values;
57 values.SetBoolean("key", 57 values.SetBoolean("key",
58 encoded_frame->dependency == EncodedFrame::KEY); 58 encoded_frame->dependency == EncodedFrame::KEY);
59 values.SetInteger("ref", encoded_frame->referenced_frame_id); 59 values.SetInteger("ref", encoded_frame->referenced_frame_id);
60 values.SetInteger("id", encoded_frame->frame_id); 60 values.SetInteger("id", encoded_frame->frame_id);
61 values.SetInteger("size", frame_size_); 61 values.SetInteger("size", frame_size_);
62 base::JSONWriter::Write(values, &encoded_frame->data); 62 base::JSONWriter::Write(values, &encoded_frame->data);
63 encoded_frame->data.resize( 63 encoded_frame->data.resize(
(...skipping 13 matching lines...) Expand all
77 } 77 }
78 78
79 void FakeSoftwareVideoEncoder::GenerateKeyFrame() { 79 void FakeSoftwareVideoEncoder::GenerateKeyFrame() {
80 next_frame_is_key_ = true; 80 next_frame_is_key_ = true;
81 } 81 }
82 82
83 } // namespace cast 83 } // namespace cast
84 } // namespace media 84 } // namespace media
85 85
86 #endif 86 #endif
OLDNEW
« no previous file with comments | « media/cast/sender/external_video_encoder.cc ('k') | media/cast/sender/frame_sender.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698