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

Unified Diff: webrtc/api/audiotrack.cc

Issue 2514883002: Create //webrtc/api:libjingle_peerconnection_api + refactorings. (Closed)
Patch Set: Rebase Created 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/api/audiotrack.h ('k') | webrtc/api/datachannel.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/api/audiotrack.cc
diff --git a/webrtc/api/audiotrack.cc b/webrtc/api/audiotrack.cc
deleted file mode 100644
index c2c9557c9e3ed56a7b1b66465e56ef93288ba245..0000000000000000000000000000000000000000
--- a/webrtc/api/audiotrack.cc
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright 2011 The WebRTC project authors. All Rights Reserved.
- *
- * Use of this source code is governed by a BSD-style license
- * that can be found in the LICENSE file in the root of the source
- * tree. An additional intellectual property rights grant can be found
- * in the file PATENTS. All contributing project authors may
- * be found in the AUTHORS file in the root of the source tree.
- */
-
-#include "webrtc/api/audiotrack.h"
-
-#include "webrtc/base/checks.h"
-
-using rtc::scoped_refptr;
-
-namespace webrtc {
-
-const char MediaStreamTrackInterface::kAudioKind[] = "audio";
-
-// static
-scoped_refptr<AudioTrack> AudioTrack::Create(
- const std::string& id,
- const scoped_refptr<AudioSourceInterface>& source) {
- return new rtc::RefCountedObject<AudioTrack>(id, source);
-}
-
-AudioTrack::AudioTrack(const std::string& label,
- const scoped_refptr<AudioSourceInterface>& source)
- : MediaStreamTrack<AudioTrackInterface>(label), audio_source_(source) {
- if (audio_source_) {
- audio_source_->RegisterObserver(this);
- OnChanged();
- }
-}
-
-AudioTrack::~AudioTrack() {
- RTC_DCHECK(thread_checker_.CalledOnValidThread());
- set_state(MediaStreamTrackInterface::kEnded);
- if (audio_source_)
- audio_source_->UnregisterObserver(this);
-}
-
-std::string AudioTrack::kind() const {
- RTC_DCHECK(thread_checker_.CalledOnValidThread());
- return kAudioKind;
-}
-
-AudioSourceInterface* AudioTrack::GetSource() const {
- RTC_DCHECK(thread_checker_.CalledOnValidThread());
- return audio_source_.get();
-}
-
-void AudioTrack::AddSink(AudioTrackSinkInterface* sink) {
- RTC_DCHECK(thread_checker_.CalledOnValidThread());
- if (audio_source_)
- audio_source_->AddSink(sink);
-}
-
-void AudioTrack::RemoveSink(AudioTrackSinkInterface* sink) {
- RTC_DCHECK(thread_checker_.CalledOnValidThread());
- if (audio_source_)
- audio_source_->RemoveSink(sink);
-}
-
-void AudioTrack::OnChanged() {
- RTC_DCHECK(thread_checker_.CalledOnValidThread());
- if (audio_source_->state() == MediaSourceInterface::kEnded) {
- set_state(kEnded);
- } else {
- set_state(kLive);
- }
-}
-
-} // namespace webrtc
« no previous file with comments | « webrtc/api/audiotrack.h ('k') | webrtc/api/datachannel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698