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

Commit d31fc239 authored by James Dong's avatar James Dong Committed by Android Git Automerger
Browse files

am 6dcdfdb4: Merge "Name the writer threads" into gingerbread

Merge commit '6dcdfdb4' into gingerbread-plus-aosp

* commit '6dcdfdb4':
  Name the writer threads
parents 14ea1048 6dcdfdb4
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -15,7 +15,6 @@
 */

#include <media/stagefright/AMRWriter.h>

#include <media/stagefright/MediaBuffer.h>
#include <media/stagefright/MediaDebug.h>
#include <media/stagefright/MediaDefs.h>
@@ -23,6 +22,8 @@
#include <media/stagefright/MediaSource.h>
#include <media/stagefright/MetaData.h>
#include <media/mediarecorder.h>
#include <sys/prctl.h>
#include <sys/resource.h>

namespace android {

@@ -194,6 +195,7 @@ status_t AMRWriter::threadFunc() {
    int64_t maxTimestampUs = 0;
    status_t err = OK;

    prctl(PR_SET_NAME, (unsigned long)"AMRWriter", 0, 0, 0);
    while (!mDone) {
        MediaBuffer *buffer;
        err = mSource->read(&buffer);
+8 −1
Original line number Diff line number Diff line
@@ -20,8 +20,9 @@

#include <arpa/inet.h>

#include <ctype.h>
#include <pthread.h>
#include <sys/prctl.h>
#include <sys/resource.h>

#include <media/stagefright/MPEG4Writer.h>
#include <media/stagefright/MediaBuffer.h>
@@ -1104,6 +1105,7 @@ status_t MPEG4Writer::writeOneChunk() {
void MPEG4Writer::threadFunc() {
    LOGV("threadFunc");

    prctl(PR_SET_NAME, (unsigned long)"MPEG4Writer", 0, 0, 0);
    while (!mDone) {
        {
            Mutex::Autolock autolock(mLock);
@@ -1632,6 +1634,11 @@ status_t MPEG4Writer::Track::threadEntry() {
    int64_t previousPausedDurationUs = 0;
    int64_t timestampUs;

    if (mIsAudio) {
        prctl(PR_SET_NAME, (unsigned long)"AudioTrackEncoding", 0, 0, 0);
    } else {
        prctl(PR_SET_NAME, (unsigned long)"VideoTrackEncoding", 0, 0, 0);
    }
    sp<MetaData> meta_data;

    mNumSamples = 0;