Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7a772896 authored by Marco Nelissen's avatar Marco Nelissen Committed by Android (Google) Code Review
Browse files

Merge "Optionally print name for fd"

parents 6dc5a7bc 83b0fd99
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -85,6 +85,8 @@ void writeToAMessage(sp<AMessage> msg, const AVSyncSettings &sync, float videoFp
void readFromAMessage(
        const sp<AMessage> &msg, AVSyncSettings *sync /* nonnull */, float *videoFps /* nonnull */);

AString nameForFd(int fd);

}  // namespace android

#endif  // UTILS_H_
+3 −1
Original line number Diff line number Diff line
@@ -58,6 +58,7 @@
#include <media/stagefright/MediaCodecList.h>
#include <media/stagefright/MediaErrors.h>
#include <media/stagefright/AudioPlayer.h>
#include <media/stagefright/Utils.h>
#include <media/stagefright/foundation/ADebug.h>
#include <media/stagefright/foundation/ALooperRoster.h>
#include <mediautils/BatteryNotifier.h>
@@ -730,7 +731,8 @@ status_t MediaPlayerService::Client::setDataSource(

status_t MediaPlayerService::Client::setDataSource(int fd, int64_t offset, int64_t length)
{
    ALOGV("setDataSource fd=%d, offset=%lld, length=%lld", fd, offset, length);
    ALOGV("setDataSource fd=%d (%s), offset=%lld, length=%lld",
            fd, nameForFd(fd).c_str(), (long long) offset, (long long) length);
    struct stat sb;
    int ret = fstat(fd, &sb);
    if (ret != 0) {
+3 −1
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@
#include <media/MediaMetadataRetrieverInterface.h>
#include <media/MediaPlayerInterface.h>
#include <media/stagefright/DataSource.h>
#include <media/stagefright/Utils.h>
#include <private/media/VideoFrame.h>
#include "MetadataRetrieverClient.h"
#include "StagefrightMetadataRetriever.h"
@@ -133,7 +134,8 @@ status_t MetadataRetrieverClient::setDataSource(

status_t MetadataRetrieverClient::setDataSource(int fd, int64_t offset, int64_t length)
{
    ALOGV("setDataSource fd=%d, offset=%lld, length=%lld", fd, offset, length);
    ALOGV("setDataSource fd=%d (%s), offset=%lld, length=%lld",
            fd, nameForFd(fd).c_str(), (long long) offset, (long long) length);
    Mutex::Autolock lock(mLock);
    struct stat sb;
    int ret = fstat(fd, &sb);
+5 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@

#include <media/stagefright/foundation/ADebug.h>
#include <media/stagefright/FileSource.h>
#include <media/stagefright/Utils.h>
#include <sys/types.h>
#include <unistd.h>
#include <sys/types.h>
@@ -38,6 +39,7 @@ FileSource::FileSource(const char *filename)
      mDrmBufSize(0),
      mDrmBuf(NULL){

    ALOGV("%s", filename);
    mFd = open(filename, O_LARGEFILE | O_RDONLY);

    if (mFd >= 0) {
@@ -56,6 +58,9 @@ FileSource::FileSource(int fd, int64_t offset, int64_t length)
      mDrmBufOffset(0),
      mDrmBufSize(0),
      mDrmBuf(NULL){
    ALOGV("fd=%d (%s), offset=%lld, length=%lld",
            fd, nameForFd(fd).c_str(), (long long) offset, (long long) length);

    CHECK(offset >= 0);
    CHECK(length >= 0);
}
+3 −0
Original line number Diff line number Diff line
@@ -129,6 +129,9 @@ status_t NuMediaExtractor::setDataSource(

status_t NuMediaExtractor::setDataSource(int fd, off64_t offset, off64_t size) {

    ALOGV("setDataSource fd=%d (%s), offset=%lld, length=%lld",
            fd, nameForFd(fd).c_str(), (long long) offset, (long long) size);

    Mutex::Autolock autoLock(mLock);

    if (mImpl != NULL) {
Loading