Commit 6697b9e6 authored by miu@chromium.org's avatar miu@chromium.org

Add audio playback (all platforms) to cast_receiver_app.

This change not only adds audio playback, but also adds an
implementation that delays rendering of video/audio frames to the
desired playout_times.  In addition, console logging has been added to
expose: 1) Whether frames were skipped because playback was running
behind; 2) Whether frames were skipped by the receiver because packets
were too late; 3) When frames are actually being played versus the
desired playout_time.

BUG=360776
R=imcheng@chromium.org

Review URL: https://codereview.chromium.org/229463002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@262796 0039d316-1c4b-4281-b951-d872f2087c98
parent 9c23369f
......@@ -336,9 +336,7 @@ IN_PROC_BROWSER_TEST_F(CastStreamingApiTestWithPixelOutput, DISABLED_EndToEnd) {
receiver->WaitForColorAndTone(kGreenInYUV, 500 /* Hz */, kOneHalfSecond);
receiver->WaitForColorAndTone(kBlueInYUV, 1800 /* Hz */, kOneHalfSecond);
// TODO(miu): Uncomment once GetWeakPtr() NULL crash in PacedSender is fixed
// (see http://crbug.com/349786):
// receiver->DestroySoon();
receiver->Stop();
cast_environment->Shutdown();
}
......
This diff is collapsed.
......@@ -66,13 +66,6 @@ void InProcessReceiver::StopOnMainThread(base::WaitableEvent* event) {
event->Signal();
}
void InProcessReceiver::DestroySoon() {
cast_environment_->PostTask(
CastEnvironment::MAIN,
FROM_HERE,
base::Bind(&InProcessReceiver::WillDestroyReceiver, base::Owned(this)));
}
void InProcessReceiver::UpdateCastTransportStatus(CastTransportStatus status) {
LOG_IF(ERROR, status == media::cast::transport::TRANSPORT_SOCKET_ERROR)
<< "Transport socket error occurred. InProcessReceiver is likely dead.";
......@@ -132,10 +125,5 @@ void InProcessReceiver::PullNextVideoFrame() {
&InProcessReceiver::GotVideoFrame, weak_factory_.GetWeakPtr()));
}
// static
void InProcessReceiver::WillDestroyReceiver(InProcessReceiver* receiver) {
DCHECK(receiver->cast_environment_->CurrentlyOn(CastEnvironment::MAIN));
}
} // namespace cast
} // namespace media
......@@ -49,7 +49,6 @@ class InProcessReceiver {
const AudioReceiverConfig& audio_config,
const VideoReceiverConfig& video_config);
// Must be destroyed on the cast MAIN thread. See DestroySoon().
virtual ~InProcessReceiver();
// Convenience accessors.
......@@ -59,17 +58,11 @@ class InProcessReceiver {
// Begin delivering any received audio/video frames to the OnXXXFrame()
// methods.
void Start();
// Schedules destruction on the cast MAIN thread. Any external references to
// the InProcessReceiver instance become invalid.
// Deprecated: Use Stop instead.
// TODO(hubbe): Remove this function and change callers to use Stop.
void DestroySoon();
virtual void Start();
// Destroy the sub-compontents of this class.
// After this call, it is safe to destroy this object on any thread.
void Stop();
virtual void Stop();
protected:
// To be implemented by subclasses. These are called on the Cast MAIN thread
......@@ -109,9 +102,6 @@ class InProcessReceiver {
void PullNextAudioFrame();
void PullNextVideoFrame();
// Invoked just before the destruction of |receiver| on the cast MAIN thread.
static void WillDestroyReceiver(InProcessReceiver* receiver);
const scoped_refptr<CastEnvironment> cast_environment_;
const net::IPEndPoint local_end_point_;
const net::IPEndPoint remote_end_point_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment