diff options
| author | Andreas Huber <andih@google.com> | 2012-08-30 10:54:27 -0700 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-08-30 10:54:28 -0700 |
| commit | 682d5593c9639090b3e08bd57570f3299df9da92 (patch) | |
| tree | 92796232fc86de18eaeb0f0fbc85efe75efe7db8 | |
| parent | 6524b7e1e6aae7dc1fe650119ec4bcf96b5a3f6b (diff) | |
| parent | 774df0dce0116c69b6d17f2e4a4912e06138e575 (diff) | |
| download | frameworks_av-682d5593c9639090b3e08bd57570f3299df9da92.zip frameworks_av-682d5593c9639090b3e08bd57570f3299df9da92.tar.gz frameworks_av-682d5593c9639090b3e08bd57570f3299df9da92.tar.bz2 | |
Merge "Optionally log the transport stream transmitted to the sink." into jb-mr1-dev
| -rw-r--r-- | media/libstagefright/wifi-display/source/PlaybackSession.cpp | 23 | ||||
| -rw-r--r-- | media/libstagefright/wifi-display/source/PlaybackSession.h | 6 |
2 files changed, 28 insertions, 1 deletions
diff --git a/media/libstagefright/wifi-display/source/PlaybackSession.cpp b/media/libstagefright/wifi-display/source/PlaybackSession.cpp index 96c9222..6b42431 100644 --- a/media/libstagefright/wifi-display/source/PlaybackSession.cpp +++ b/media/libstagefright/wifi-display/source/PlaybackSession.cpp @@ -132,8 +132,16 @@ WifiDisplaySource::PlaybackSession::PlaybackSession( mNumSRsSent(0), mSendSRPending(false), mFirstPacketTimeUs(-1ll), - mHistoryLength(0) { + mHistoryLength(0) +#if LOG_TRANSPORT_STREAM + ,mLogFile(NULL) +#endif +{ mTSQueue->setRange(0, 12); + +#if LOG_TRANSPORT_STREAM + mLogFile = fopen("/system/etc/log.ts", "wb"); +#endif } status_t WifiDisplaySource::PlaybackSession::init( @@ -215,6 +223,13 @@ status_t WifiDisplaySource::PlaybackSession::init( } WifiDisplaySource::PlaybackSession::~PlaybackSession() { +#if LOG_TRANSPORT_STREAM + if (mLogFile != NULL) { + fclose(mLogFile); + mLogFile = NULL; + } +#endif + mTracks.clear(); if (mCodecLooper != NULL) { @@ -470,6 +485,12 @@ void WifiDisplaySource::PlaybackSession::onMessageReceived( true /* timeDiscontinuity */, lastTSPacket /* flush */); } + +#if LOG_TRANSPORT_STREAM + if (mLogFile != NULL) { + fwrite(packets->data(), 1, packets->size(), mLogFile); + } +#endif } } else if (what == Converter::kWhatEOS) { CHECK_EQ(what, Converter::kWhatEOS); diff --git a/media/libstagefright/wifi-display/source/PlaybackSession.h b/media/libstagefright/wifi-display/source/PlaybackSession.h index d256fc4..a6c9f27 100644 --- a/media/libstagefright/wifi-display/source/PlaybackSession.h +++ b/media/libstagefright/wifi-display/source/PlaybackSession.h @@ -26,6 +26,8 @@ struct ABuffer; struct Serializer; struct TSPacketizer; +#define LOG_TRANSPORT_STREAM 0 + // Encapsulates the state of an RTP/RTCP session in the context of wifi // display. struct WifiDisplaySource::PlaybackSession : public AHandler { @@ -111,6 +113,10 @@ private: List<sp<ABuffer> > mHistory; size_t mHistoryLength; +#if LOG_TRANSPORT_STREAM + FILE *mLogFile; +#endif + void onSendSR(); void addSR(const sp<ABuffer> &buffer); void addSDES(const sp<ABuffer> &buffer); |
