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:
Andreas Huber
2009-10-13 10:41:12 -07:00
committed by Android Git Automerger
23 changed files with 56 additions and 36 deletions

View File

@@ -19,10 +19,11 @@
#define HTTP_DATASOURCE_H_
#include <media/stagefright/DataSource.h>
#include <media/stagefright/HTTPStream.h>
namespace android {
class HTTPStream;
class HTTPDataSource : public DataSource {
public:
HTTPDataSource(const char *host, int port, const char *path);
@@ -40,7 +41,7 @@ private:
kBufferSize = 64 * 1024
};
HTTPStream mHttp;
HTTPStream *mHttp;
char *mHost;
int mPort;
char *mPath;

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
#include <media/stagefright/ESDS.h>
#include "include/ESDS.h"
#include <string.h>

View File

@@ -14,17 +14,19 @@
* limitations under the License.
*/
#include "include/string.h"
#include "include/HTTPStream.h"
#include <stdlib.h>
#include <media/stagefright/HTTPDataSource.h>
#include <media/stagefright/HTTPStream.h>
#include <media/stagefright/MediaDebug.h>
#include <media/stagefright/string.h>
namespace android {
HTTPDataSource::HTTPDataSource(const char *uri)
: mHost(NULL),
: mHttp(new HTTPStream),
mHost(NULL),
mPort(0),
mPath(NULL),
mBuffer(malloc(kBufferSize)),
@@ -65,29 +67,33 @@ HTTPDataSource::HTTPDataSource(const char *uri)
mPort = port;
mPath = strdup(path.c_str());
status_t err = mHttp.connect(mHost, mPort);
status_t err = mHttp->connect(mHost, mPort);
CHECK_EQ(err, OK);
}
HTTPDataSource::HTTPDataSource(const char *host, int port, const char *path)
: mHost(strdup(host)),
: mHttp(new HTTPStream),
mHost(strdup(host)),
mPort(port),
mPath(strdup(path)),
mBuffer(malloc(kBufferSize)),
mBufferLength(0),
mBufferOffset(0) {
status_t err = mHttp.connect(mHost, mPort);
status_t err = mHttp->connect(mHost, mPort);
CHECK_EQ(err, OK);
}
HTTPDataSource::~HTTPDataSource() {
mHttp.disconnect();
mHttp->disconnect();
free(mBuffer);
mBuffer = NULL;
free(mPath);
mPath = NULL;
delete mHttp;
mHttp = NULL;
}
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;
int attempt = 1;
for (;;) {
if ((err = mHttp.send("GET ")) != OK
|| (err = mHttp.send(mPath)) != OK
|| (err = mHttp.send(" HTTP/1.1\r\n")) != OK
|| (err = mHttp.send(host)) != OK
|| (err = mHttp.send(range)) != OK
|| (err = mHttp.send("\r\n")) != OK
|| (err = mHttp.receive_header(&http_status)) != OK) {
if ((err = mHttp->send("GET ")) != OK
|| (err = mHttp->send(mPath)) != OK
|| (err = mHttp->send(" HTTP/1.1\r\n")) != OK
|| (err = mHttp->send(host)) != OK
|| (err = mHttp->send(range)) != OK
|| (err = mHttp->send("\r\n")) != OK
|| (err = mHttp->receive_header(&http_status)) != OK) {
if (attempt == 3) {
return err;
}
mHttp.connect(mHost, mPort);
mHttp->connect(mHost, mPort);
++attempt;
} else {
break;
@@ -144,14 +150,14 @@ ssize_t HTTPDataSource::read_at(off_t offset, void *data, size_t size) {
}
string value;
if (!mHttp.find_header_value("Content-Length", &value)) {
if (!mHttp->find_header_value("Content-Length", &value)) {
return UNKNOWN_ERROR;
}
char *end;
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) {
return num_bytes_received;

View File

@@ -14,6 +14,8 @@
* limitations under the License.
*/
#include "include/HTTPStream.h"
#include <sys/socket.h>
#include <arpa/inet.h>
@@ -25,7 +27,6 @@
#include <string.h>
#include <unistd.h>
#include <media/stagefright/HTTPStream.h>
#include <media/stagefright/MediaDebug.h>
namespace android {

View File

@@ -17,6 +17,8 @@
#define LOG_TAG "MPEG4Extractor"
#include <utils/Log.h>
#include "include/SampleTable.h"
#include <arpa/inet.h>
#include <ctype.h>
@@ -32,7 +34,6 @@
#include <media/stagefright/MediaDefs.h>
#include <media/stagefright/MediaSource.h>
#include <media/stagefright/MetaData.h>
#include <media/stagefright/SampleTable.h>
#include <media/stagefright/Utils.h>
#include <utils/String8.h>

View File

@@ -18,6 +18,9 @@
#define LOG_TAG "MediaPlayerImpl"
#include "utils/Log.h"
#include "include/string.h"
#include "include/HTTPStream.h"
#include <OMX_Component.h>
#include <unistd.h>
@@ -26,7 +29,6 @@
#include <media/stagefright/CachingDataSource.h>
// #include <media/stagefright/CameraSource.h>
#include <media/stagefright/HTTPDataSource.h>
#include <media/stagefright/HTTPStream.h>
#include <media/stagefright/MediaDebug.h>
#include <media/stagefright/MediaExtractor.h>
#include <media/stagefright/MediaPlayerImpl.h>

View File

@@ -18,11 +18,12 @@
#define LOG_TAG "OMXCodec"
#include <utils/Log.h>
#include "include/ESDS.h"
#include <binder/IServiceManager.h>
#include <binder/MemoryDealer.h>
#include <binder/ProcessState.h>
#include <media/IMediaPlayerService.h>
#include <media/stagefright/ESDS.h>
#include <media/stagefright/MediaBuffer.h>
#include <media/stagefright/MediaBufferGroup.h>
#include <media/stagefright/MediaDebug.h>

View File

@@ -17,11 +17,12 @@
#define LOG_TAG "SampleTable"
#include <utils/Log.h>
#include "include/SampleTable.h"
#include <arpa/inet.h>
#include <media/stagefright/DataSource.h>
#include <media/stagefright/MediaDebug.h>
#include <media/stagefright/SampleTable.h>
#include <media/stagefright/Utils.h>
namespace android {

View File

@@ -14,16 +14,17 @@
* limitations under the License.
*/
#include "include/string.h"
#include "include/HTTPStream.h"
#include <stdlib.h>
#include <media/stagefright/HTTPStream.h>
#include <media/stagefright/MediaBuffer.h>
#include <media/stagefright/MediaBufferGroup.h>
#include <media/stagefright/MediaDebug.h>
#include <media/stagefright/MediaDefs.h>
#include <media/stagefright/MetaData.h>
#include <media/stagefright/ShoutcastSource.h>
#include <media/stagefright/string.h>
namespace android {

View File

@@ -22,10 +22,11 @@
#define LOG_TAG "TimedEventQueue"
#include <utils/Log.h>
#include "include/TimedEventQueue.h"
#include <sys/time.h>
#include <media/stagefright/MediaDebug.h>
#include <media/stagefright/TimedEventQueue.h>
namespace android {

View File

@@ -18,10 +18,11 @@
#define HTTP_STREAM_H_
#include "string.h"
#include <sys/types.h>
#include <media/stagefright/MediaErrors.h>
#include <media/stagefright/string.h>
#include <utils/KeyedVector.h>
namespace android {

View File

@@ -25,11 +25,12 @@
#include "pv_omxcore.h"
#include "../include/QComHardwareRenderer.h"
#include "../include/SoftwareRenderer.h"
#include "../include/TIHardwareRenderer.h"
#include <binder/IMemory.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 <OMX_Component.h>

View File

@@ -14,10 +14,11 @@
* limitations under the License.
*/
#include "../include/QComHardwareRenderer.h"
#include <binder/MemoryHeapBase.h>
#include <binder/MemoryHeapPmem.h>
#include <media/stagefright/MediaDebug.h>
#include <media/stagefright/QComHardwareRenderer.h>
#include <ui/ISurface.h>
namespace android {

View File

@@ -17,9 +17,10 @@
#define LOG_TAG "SoftwareRenderer"
#include <utils/Log.h>
#include "../include/SoftwareRenderer.h"
#include <binder/MemoryHeapBase.h>
#include <media/stagefright/MediaDebug.h>
#include <media/stagefright/SoftwareRenderer.h>
#include <ui/ISurface.h>
namespace android {

View File

@@ -17,7 +17,8 @@
#define LOG_TAG "TIHardwareRenderer"
#include <utils/Log.h>
#include <media/stagefright/TIHardwareRenderer.h>
#include "../include/TIHardwareRenderer.h"
#include <media/stagefright/MediaDebug.h>
#include <ui/ISurface.h>
#include <ui/Overlay.h>

View File

@@ -14,7 +14,7 @@
* limitations under the License.
*/
#include <media/stagefright/string.h>
#include "include/string.h"
namespace android {