am c642199d: Merge change Ibd7b43bb into eclair-mr2
Merge commit 'c642199d1d60176980e2781bb78f42dce93e1c84' into eclair-mr2-plus-aosp * commit 'c642199d1d60176980e2781bb78f42dce93e1c84': Separated private from public header files.
This commit is contained in:
@@ -19,10 +19,11 @@
|
|||||||
#define HTTP_DATASOURCE_H_
|
#define HTTP_DATASOURCE_H_
|
||||||
|
|
||||||
#include <media/stagefright/DataSource.h>
|
#include <media/stagefright/DataSource.h>
|
||||||
#include <media/stagefright/HTTPStream.h>
|
|
||||||
|
|
||||||
namespace android {
|
namespace android {
|
||||||
|
|
||||||
|
class HTTPStream;
|
||||||
|
|
||||||
class HTTPDataSource : public DataSource {
|
class HTTPDataSource : public DataSource {
|
||||||
public:
|
public:
|
||||||
HTTPDataSource(const char *host, int port, const char *path);
|
HTTPDataSource(const char *host, int port, const char *path);
|
||||||
@@ -40,7 +41,7 @@ private:
|
|||||||
kBufferSize = 64 * 1024
|
kBufferSize = 64 * 1024
|
||||||
};
|
};
|
||||||
|
|
||||||
HTTPStream mHttp;
|
HTTPStream *mHttp;
|
||||||
char *mHost;
|
char *mHost;
|
||||||
int mPort;
|
int mPort;
|
||||||
char *mPath;
|
char *mPath;
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <media/stagefright/ESDS.h>
|
#include "include/ESDS.h"
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
|||||||
@@ -14,17 +14,19 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "include/string.h"
|
||||||
|
#include "include/HTTPStream.h"
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include <media/stagefright/HTTPDataSource.h>
|
#include <media/stagefright/HTTPDataSource.h>
|
||||||
#include <media/stagefright/HTTPStream.h>
|
|
||||||
#include <media/stagefright/MediaDebug.h>
|
#include <media/stagefright/MediaDebug.h>
|
||||||
#include <media/stagefright/string.h>
|
|
||||||
|
|
||||||
namespace android {
|
namespace android {
|
||||||
|
|
||||||
HTTPDataSource::HTTPDataSource(const char *uri)
|
HTTPDataSource::HTTPDataSource(const char *uri)
|
||||||
: mHost(NULL),
|
: mHttp(new HTTPStream),
|
||||||
|
mHost(NULL),
|
||||||
mPort(0),
|
mPort(0),
|
||||||
mPath(NULL),
|
mPath(NULL),
|
||||||
mBuffer(malloc(kBufferSize)),
|
mBuffer(malloc(kBufferSize)),
|
||||||
@@ -65,29 +67,33 @@ HTTPDataSource::HTTPDataSource(const char *uri)
|
|||||||
mPort = port;
|
mPort = port;
|
||||||
mPath = strdup(path.c_str());
|
mPath = strdup(path.c_str());
|
||||||
|
|
||||||
status_t err = mHttp.connect(mHost, mPort);
|
status_t err = mHttp->connect(mHost, mPort);
|
||||||
CHECK_EQ(err, OK);
|
CHECK_EQ(err, OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
HTTPDataSource::HTTPDataSource(const char *host, int port, const char *path)
|
HTTPDataSource::HTTPDataSource(const char *host, int port, const char *path)
|
||||||
: mHost(strdup(host)),
|
: mHttp(new HTTPStream),
|
||||||
|
mHost(strdup(host)),
|
||||||
mPort(port),
|
mPort(port),
|
||||||
mPath(strdup(path)),
|
mPath(strdup(path)),
|
||||||
mBuffer(malloc(kBufferSize)),
|
mBuffer(malloc(kBufferSize)),
|
||||||
mBufferLength(0),
|
mBufferLength(0),
|
||||||
mBufferOffset(0) {
|
mBufferOffset(0) {
|
||||||
status_t err = mHttp.connect(mHost, mPort);
|
status_t err = mHttp->connect(mHost, mPort);
|
||||||
CHECK_EQ(err, OK);
|
CHECK_EQ(err, OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
HTTPDataSource::~HTTPDataSource() {
|
HTTPDataSource::~HTTPDataSource() {
|
||||||
mHttp.disconnect();
|
mHttp->disconnect();
|
||||||
|
|
||||||
free(mBuffer);
|
free(mBuffer);
|
||||||
mBuffer = NULL;
|
mBuffer = NULL;
|
||||||
|
|
||||||
free(mPath);
|
free(mPath);
|
||||||
mPath = NULL;
|
mPath = NULL;
|
||||||
|
|
||||||
|
delete mHttp;
|
||||||
|
mHttp = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
ssize_t HTTPDataSource::read_at(off_t offset, void *data, size_t size) {
|
ssize_t HTTPDataSource::read_at(off_t offset, void *data, size_t size) {
|
||||||
@@ -120,19 +126,19 @@ ssize_t HTTPDataSource::read_at(off_t offset, void *data, size_t size) {
|
|||||||
status_t err;
|
status_t err;
|
||||||
int attempt = 1;
|
int attempt = 1;
|
||||||
for (;;) {
|
for (;;) {
|
||||||
if ((err = mHttp.send("GET ")) != OK
|
if ((err = mHttp->send("GET ")) != OK
|
||||||
|| (err = mHttp.send(mPath)) != OK
|
|| (err = mHttp->send(mPath)) != OK
|
||||||
|| (err = mHttp.send(" HTTP/1.1\r\n")) != OK
|
|| (err = mHttp->send(" HTTP/1.1\r\n")) != OK
|
||||||
|| (err = mHttp.send(host)) != OK
|
|| (err = mHttp->send(host)) != OK
|
||||||
|| (err = mHttp.send(range)) != OK
|
|| (err = mHttp->send(range)) != OK
|
||||||
|| (err = mHttp.send("\r\n")) != OK
|
|| (err = mHttp->send("\r\n")) != OK
|
||||||
|| (err = mHttp.receive_header(&http_status)) != OK) {
|
|| (err = mHttp->receive_header(&http_status)) != OK) {
|
||||||
|
|
||||||
if (attempt == 3) {
|
if (attempt == 3) {
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
mHttp.connect(mHost, mPort);
|
mHttp->connect(mHost, mPort);
|
||||||
++attempt;
|
++attempt;
|
||||||
} else {
|
} else {
|
||||||
break;
|
break;
|
||||||
@@ -144,14 +150,14 @@ ssize_t HTTPDataSource::read_at(off_t offset, void *data, size_t size) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
string value;
|
string value;
|
||||||
if (!mHttp.find_header_value("Content-Length", &value)) {
|
if (!mHttp->find_header_value("Content-Length", &value)) {
|
||||||
return UNKNOWN_ERROR;
|
return UNKNOWN_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
char *end;
|
char *end;
|
||||||
unsigned long contentLength = strtoul(value.c_str(), &end, 10);
|
unsigned long contentLength = strtoul(value.c_str(), &end, 10);
|
||||||
|
|
||||||
ssize_t num_bytes_received = mHttp.receive(mBuffer, contentLength);
|
ssize_t num_bytes_received = mHttp->receive(mBuffer, contentLength);
|
||||||
|
|
||||||
if (num_bytes_received <= 0) {
|
if (num_bytes_received <= 0) {
|
||||||
return num_bytes_received;
|
return num_bytes_received;
|
||||||
|
|||||||
@@ -14,6 +14,8 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "include/HTTPStream.h"
|
||||||
|
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
|
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
@@ -25,7 +27,6 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#include <media/stagefright/HTTPStream.h>
|
|
||||||
#include <media/stagefright/MediaDebug.h>
|
#include <media/stagefright/MediaDebug.h>
|
||||||
|
|
||||||
namespace android {
|
namespace android {
|
||||||
|
|||||||
@@ -17,6 +17,8 @@
|
|||||||
#define LOG_TAG "MPEG4Extractor"
|
#define LOG_TAG "MPEG4Extractor"
|
||||||
#include <utils/Log.h>
|
#include <utils/Log.h>
|
||||||
|
|
||||||
|
#include "include/SampleTable.h"
|
||||||
|
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
@@ -32,7 +34,6 @@
|
|||||||
#include <media/stagefright/MediaDefs.h>
|
#include <media/stagefright/MediaDefs.h>
|
||||||
#include <media/stagefright/MediaSource.h>
|
#include <media/stagefright/MediaSource.h>
|
||||||
#include <media/stagefright/MetaData.h>
|
#include <media/stagefright/MetaData.h>
|
||||||
#include <media/stagefright/SampleTable.h>
|
|
||||||
#include <media/stagefright/Utils.h>
|
#include <media/stagefright/Utils.h>
|
||||||
#include <utils/String8.h>
|
#include <utils/String8.h>
|
||||||
|
|
||||||
|
|||||||
@@ -18,6 +18,9 @@
|
|||||||
#define LOG_TAG "MediaPlayerImpl"
|
#define LOG_TAG "MediaPlayerImpl"
|
||||||
#include "utils/Log.h"
|
#include "utils/Log.h"
|
||||||
|
|
||||||
|
#include "include/string.h"
|
||||||
|
#include "include/HTTPStream.h"
|
||||||
|
|
||||||
#include <OMX_Component.h>
|
#include <OMX_Component.h>
|
||||||
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
@@ -26,7 +29,6 @@
|
|||||||
#include <media/stagefright/CachingDataSource.h>
|
#include <media/stagefright/CachingDataSource.h>
|
||||||
// #include <media/stagefright/CameraSource.h>
|
// #include <media/stagefright/CameraSource.h>
|
||||||
#include <media/stagefright/HTTPDataSource.h>
|
#include <media/stagefright/HTTPDataSource.h>
|
||||||
#include <media/stagefright/HTTPStream.h>
|
|
||||||
#include <media/stagefright/MediaDebug.h>
|
#include <media/stagefright/MediaDebug.h>
|
||||||
#include <media/stagefright/MediaExtractor.h>
|
#include <media/stagefright/MediaExtractor.h>
|
||||||
#include <media/stagefright/MediaPlayerImpl.h>
|
#include <media/stagefright/MediaPlayerImpl.h>
|
||||||
|
|||||||
@@ -18,11 +18,12 @@
|
|||||||
#define LOG_TAG "OMXCodec"
|
#define LOG_TAG "OMXCodec"
|
||||||
#include <utils/Log.h>
|
#include <utils/Log.h>
|
||||||
|
|
||||||
|
#include "include/ESDS.h"
|
||||||
|
|
||||||
#include <binder/IServiceManager.h>
|
#include <binder/IServiceManager.h>
|
||||||
#include <binder/MemoryDealer.h>
|
#include <binder/MemoryDealer.h>
|
||||||
#include <binder/ProcessState.h>
|
#include <binder/ProcessState.h>
|
||||||
#include <media/IMediaPlayerService.h>
|
#include <media/IMediaPlayerService.h>
|
||||||
#include <media/stagefright/ESDS.h>
|
|
||||||
#include <media/stagefright/MediaBuffer.h>
|
#include <media/stagefright/MediaBuffer.h>
|
||||||
#include <media/stagefright/MediaBufferGroup.h>
|
#include <media/stagefright/MediaBufferGroup.h>
|
||||||
#include <media/stagefright/MediaDebug.h>
|
#include <media/stagefright/MediaDebug.h>
|
||||||
|
|||||||
@@ -17,11 +17,12 @@
|
|||||||
#define LOG_TAG "SampleTable"
|
#define LOG_TAG "SampleTable"
|
||||||
#include <utils/Log.h>
|
#include <utils/Log.h>
|
||||||
|
|
||||||
|
#include "include/SampleTable.h"
|
||||||
|
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
|
|
||||||
#include <media/stagefright/DataSource.h>
|
#include <media/stagefright/DataSource.h>
|
||||||
#include <media/stagefright/MediaDebug.h>
|
#include <media/stagefright/MediaDebug.h>
|
||||||
#include <media/stagefright/SampleTable.h>
|
|
||||||
#include <media/stagefright/Utils.h>
|
#include <media/stagefright/Utils.h>
|
||||||
|
|
||||||
namespace android {
|
namespace android {
|
||||||
|
|||||||
@@ -14,16 +14,17 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "include/string.h"
|
||||||
|
#include "include/HTTPStream.h"
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include <media/stagefright/HTTPStream.h>
|
|
||||||
#include <media/stagefright/MediaBuffer.h>
|
#include <media/stagefright/MediaBuffer.h>
|
||||||
#include <media/stagefright/MediaBufferGroup.h>
|
#include <media/stagefright/MediaBufferGroup.h>
|
||||||
#include <media/stagefright/MediaDebug.h>
|
#include <media/stagefright/MediaDebug.h>
|
||||||
#include <media/stagefright/MediaDefs.h>
|
#include <media/stagefright/MediaDefs.h>
|
||||||
#include <media/stagefright/MetaData.h>
|
#include <media/stagefright/MetaData.h>
|
||||||
#include <media/stagefright/ShoutcastSource.h>
|
#include <media/stagefright/ShoutcastSource.h>
|
||||||
#include <media/stagefright/string.h>
|
|
||||||
|
|
||||||
namespace android {
|
namespace android {
|
||||||
|
|
||||||
|
|||||||
@@ -22,10 +22,11 @@
|
|||||||
#define LOG_TAG "TimedEventQueue"
|
#define LOG_TAG "TimedEventQueue"
|
||||||
#include <utils/Log.h>
|
#include <utils/Log.h>
|
||||||
|
|
||||||
|
#include "include/TimedEventQueue.h"
|
||||||
|
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
|
|
||||||
#include <media/stagefright/MediaDebug.h>
|
#include <media/stagefright/MediaDebug.h>
|
||||||
#include <media/stagefright/TimedEventQueue.h>
|
|
||||||
|
|
||||||
namespace android {
|
namespace android {
|
||||||
|
|
||||||
|
|||||||
@@ -18,10 +18,11 @@
|
|||||||
|
|
||||||
#define HTTP_STREAM_H_
|
#define HTTP_STREAM_H_
|
||||||
|
|
||||||
|
#include "string.h"
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
#include <media/stagefright/MediaErrors.h>
|
#include <media/stagefright/MediaErrors.h>
|
||||||
#include <media/stagefright/string.h>
|
|
||||||
#include <utils/KeyedVector.h>
|
#include <utils/KeyedVector.h>
|
||||||
|
|
||||||
namespace android {
|
namespace android {
|
||||||
@@ -25,11 +25,12 @@
|
|||||||
|
|
||||||
#include "pv_omxcore.h"
|
#include "pv_omxcore.h"
|
||||||
|
|
||||||
|
#include "../include/QComHardwareRenderer.h"
|
||||||
|
#include "../include/SoftwareRenderer.h"
|
||||||
|
#include "../include/TIHardwareRenderer.h"
|
||||||
|
|
||||||
#include <binder/IMemory.h>
|
#include <binder/IMemory.h>
|
||||||
#include <media/stagefright/MediaDebug.h>
|
#include <media/stagefright/MediaDebug.h>
|
||||||
#include <media/stagefright/QComHardwareRenderer.h>
|
|
||||||
#include <media/stagefright/SoftwareRenderer.h>
|
|
||||||
#include <media/stagefright/TIHardwareRenderer.h>
|
|
||||||
#include <media/stagefright/VideoRenderer.h>
|
#include <media/stagefright/VideoRenderer.h>
|
||||||
|
|
||||||
#include <OMX_Component.h>
|
#include <OMX_Component.h>
|
||||||
|
|||||||
@@ -14,10 +14,11 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "../include/QComHardwareRenderer.h"
|
||||||
|
|
||||||
#include <binder/MemoryHeapBase.h>
|
#include <binder/MemoryHeapBase.h>
|
||||||
#include <binder/MemoryHeapPmem.h>
|
#include <binder/MemoryHeapPmem.h>
|
||||||
#include <media/stagefright/MediaDebug.h>
|
#include <media/stagefright/MediaDebug.h>
|
||||||
#include <media/stagefright/QComHardwareRenderer.h>
|
|
||||||
#include <ui/ISurface.h>
|
#include <ui/ISurface.h>
|
||||||
|
|
||||||
namespace android {
|
namespace android {
|
||||||
|
|||||||
@@ -17,9 +17,10 @@
|
|||||||
#define LOG_TAG "SoftwareRenderer"
|
#define LOG_TAG "SoftwareRenderer"
|
||||||
#include <utils/Log.h>
|
#include <utils/Log.h>
|
||||||
|
|
||||||
|
#include "../include/SoftwareRenderer.h"
|
||||||
|
|
||||||
#include <binder/MemoryHeapBase.h>
|
#include <binder/MemoryHeapBase.h>
|
||||||
#include <media/stagefright/MediaDebug.h>
|
#include <media/stagefright/MediaDebug.h>
|
||||||
#include <media/stagefright/SoftwareRenderer.h>
|
|
||||||
#include <ui/ISurface.h>
|
#include <ui/ISurface.h>
|
||||||
|
|
||||||
namespace android {
|
namespace android {
|
||||||
|
|||||||
@@ -17,7 +17,8 @@
|
|||||||
#define LOG_TAG "TIHardwareRenderer"
|
#define LOG_TAG "TIHardwareRenderer"
|
||||||
#include <utils/Log.h>
|
#include <utils/Log.h>
|
||||||
|
|
||||||
#include <media/stagefright/TIHardwareRenderer.h>
|
#include "../include/TIHardwareRenderer.h"
|
||||||
|
|
||||||
#include <media/stagefright/MediaDebug.h>
|
#include <media/stagefright/MediaDebug.h>
|
||||||
#include <ui/ISurface.h>
|
#include <ui/ISurface.h>
|
||||||
#include <ui/Overlay.h>
|
#include <ui/Overlay.h>
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <media/stagefright/string.h>
|
#include "include/string.h"
|
||||||
|
|
||||||
namespace android {
|
namespace android {
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user