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

Commit 0d2ef4b9 authored by Lajos Molnar's avatar Lajos Molnar Committed by Android (Google) Code Review
Browse files

Merge "stagefright/rtsp: Remove dependence on OMXSource" into nyc-dev

parents fac3e82e 27b70ced
Loading
Loading
Loading
Loading
+6 −5
Original line number Diff line number Diff line
@@ -44,16 +44,17 @@ include $(BUILD_STATIC_LIBRARY)
include $(CLEAR_VARS)

LOCAL_SRC_FILES := \
        rtp_test.cpp
	rtp_test.cpp \

LOCAL_SHARED_LIBRARIES := \
	libstagefright liblog libutils libbinder libstagefright_foundation
	libstagefright liblog libutils libbinder libstagefright_foundation libmedia

LOCAL_STATIC_LIBRARIES := \
	libstagefright_rtsp

LOCAL_C_INCLUDES := \
	frameworks/av/media/libstagefright \
	frameworks/av/cmds/stagefright \
	$(TOP)/frameworks/native/include/media/openmax

LOCAL_CFLAGS += -Wno-multichar -Werror -Wall
+15 −12
Original line number Diff line number Diff line
@@ -31,9 +31,10 @@

#ifdef ANDROID
#include "VideoSource.h"

#include <media/stagefright/OMXClient.h>
#include <media/stagefright/OMXCodec.h>
#include <media/stagefright/foundation/ABuffer.h>
#include <media/stagefright/foundation/ALooper.h>
#include <media/stagefright/foundation/AMessage.h>
#include <media/stagefright/MediaCodecSource.h>
#endif

namespace android {
@@ -109,17 +110,19 @@ struct MyTransmitter : public AHandler {

        sp<MediaSource> source = new VideoSource(width, height);

        sp<MetaData> encMeta = new MetaData;
        encMeta->setCString(kKeyMIMEType, MEDIA_MIMETYPE_VIDEO_AVC);
        encMeta->setInt32(kKeyWidth, width);
        encMeta->setInt32(kKeyHeight, height);
        sp<AMessage> encMeta = new AMessage;
        encMeta->setString("mime", MEDIA_MIMETYPE_VIDEO_AVC);
        encMeta->setInt32("width", width);
        encMeta->setInt32("height", height);
        encMeta->setInt32("frame-rate", 30);
        encMeta->setInt32("bitrate", 256000);
        encMeta->setInt32("i-frame-interval", 10);

        OMXClient client;
        client.connect();
        sp<ALooper> encLooper = new ALooper;
        encLooper->setName("rtsp_transmitter");
        encLooper->start();

        mEncoder = OMXCodec::Create(
                client.interface(), encMeta,
                true /* createEncoder */, source);
        mEncoder = MediaCodecSource::Create(encLooper, encMeta, source);

        mEncoder->start();

+6 −13
Original line number Diff line number Diff line
@@ -20,13 +20,13 @@

#include <binder/ProcessState.h>

#include <media/stagefright/foundation/base64.h>
#include <media/stagefright/foundation/ADebug.h>
#include <media/stagefright/foundation/ALooper.h>
#include <media/stagefright/DataSource.h>
#include <media/stagefright/MediaBuffer.h>
#include <media/stagefright/MetaData.h>
#include <media/stagefright/OMXClient.h>
#include <media/stagefright/OMXCodec.h>
#include <media/stagefright/foundation/base64.h>
#include <media/stagefright/SimpleDecodingSource.h>

#include "ARTPSession.h"
#include "ASessionDescription.h"
@@ -178,15 +178,8 @@ int main(int argc, char **argv) {
    CHECK_EQ(session->countTracks(), 1u);
    sp<MediaSource> source = session->trackAt(0);

    OMXClient client;
    CHECK_EQ(client.connect(), (status_t)OK);

    sp<MediaSource> decoder = OMXCodec::Create(
            client.interface(),
            source->getFormat(), false /* createEncoder */,
            source,
            NULL,
            0);  // OMXCodec::kPreferSoftwareCodecs);
    sp<MediaSource> decoder = SimpleDecodingSource::Create(
            source, 0 /* flags: ACodec::kPreferSoftwareCodecs */);
    CHECK(decoder != NULL);

    CHECK_EQ(decoder->start(), (status_t)OK);
@@ -213,7 +206,7 @@ int main(int argc, char **argv) {
            int64_t timeUs;
            CHECK(buffer->meta_data()->findInt64(kKeyTime, &timeUs));

            printf("decoder returned frame of size %d at time %.2f secs\n",
            printf("decoder returned frame of size %zu at time %.2f secs\n",
                   buffer->range_length(), timeUs / 1E6);
        }
#endif