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

Side by Side Diff: media/cast/audio_sender/audio_encoder.cc

Issue 270493003: Cast: Deduplicate event types in cast library. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 7 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/audio_sender/audio_encoder.h" 5 #include "media/cast/audio_sender/audio_encoder.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 if (!cast_environment->CurrentlyOn(CastEnvironment::MAIN)) { 42 if (!cast_environment->CurrentlyOn(CastEnvironment::MAIN)) {
43 cast_environment->PostTask( 43 cast_environment->PostTask(
44 CastEnvironment::MAIN, 44 CastEnvironment::MAIN,
45 FROM_HERE, 45 FROM_HERE,
46 base::Bind(&LogAudioFrameEncodedEvent, 46 base::Bind(&LogAudioFrameEncodedEvent,
47 cast_environment, event_time, 47 cast_environment, event_time,
48 rtp_timestamp, frame_id, frame_size)); 48 rtp_timestamp, frame_id, frame_size));
49 return; 49 return;
50 } 50 }
51 cast_environment->Logging()->InsertEncodedFrameEvent( 51 cast_environment->Logging()->InsertEncodedFrameEvent(
52 event_time, kAudioFrameEncoded, rtp_timestamp, frame_id, 52 event_time, media::cast::FRAME_ENCODED, media::cast::AUDIO_EVENT,
53 rtp_timestamp, frame_id,
53 static_cast<int>(frame_size), /* key_frame - unused */ false, 54 static_cast<int>(frame_size), /* key_frame - unused */ false,
54 /*target_bitrate - unused*/ 0); 55 /*target_bitrate - unused*/ 0);
55 } 56 }
56 57
57 } // namespace 58 } // namespace
58 59
59 60
60 // Base class that handles the common problem of feeding one or more AudioBus' 61 // Base class that handles the common problem of feeding one or more AudioBus'
61 // data into a buffer and then, once the buffer is full, encoding the signal and 62 // data into a buffer and then, once the buffer is full, encoding the signal and
62 // emitting an EncodedAudioFrame via the FrameEncodedCallback. 63 // emitting an EncodedAudioFrame via the FrameEncodedCallback.
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
400 cast_environment_->PostTask(CastEnvironment::AUDIO, 401 cast_environment_->PostTask(CastEnvironment::AUDIO,
401 FROM_HERE, 402 FROM_HERE,
402 base::Bind(&AudioEncoder::ImplBase::EncodeAudio, 403 base::Bind(&AudioEncoder::ImplBase::EncodeAudio,
403 impl_, 404 impl_,
404 base::Passed(&audio_bus), 405 base::Passed(&audio_bus),
405 recorded_time)); 406 recorded_time));
406 } 407 }
407 408
408 } // namespace cast 409 } // namespace cast
409 } // namespace media 410 } // namespace media
OLDNEW
« no previous file with comments | « media/cast/audio_receiver/audio_receiver_unittest.cc ('k') | media/cast/audio_sender/audio_sender.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698