libeplayer3: let writers use AVPacket

This commit is contained in:
martii
2014-04-05 16:17:57 +02:00
parent 2d0ca622f8
commit 1a04102c23
15 changed files with 77 additions and 110 deletions

View File

@@ -103,7 +103,7 @@ static int writeData(WriterAVCallData_t *call)
h263_printf(10, "VideoPts %lld\n", call->Pts);
if ((call->data == NULL) || (call->len <= 0)) {
if ((call->packet->data == NULL) || (call->packet->size <= 0)) {
h263_err("NULL Data. ignoring...\n");
return 0;
}
@@ -114,11 +114,11 @@ static int writeData(WriterAVCallData_t *call)
}
int HeaderLength =
InsertPesHeader(PesHeader, call->len, H263_VIDEO_PES_START_CODE,
InsertPesHeader(PesHeader, call->packet->size, H263_VIDEO_PES_START_CODE,
call->Pts, 0);
int PrivateHeaderLength =
InsertVideoPrivateDataHeader(&PesHeader[HeaderLength], call->len);
InsertVideoPrivateDataHeader(&PesHeader[HeaderLength], call->packet->size);
int PesLength =
PesHeader[PES_LENGTH_BYTE_0] +
@@ -134,8 +134,8 @@ static int writeData(WriterAVCallData_t *call)
struct iovec iov[2];
iov[0].iov_base = PesHeader;
iov[0].iov_len = HeaderLength;
iov[1].iov_base = call->data;
iov[1].iov_len = call->len;
iov[1].iov_base = call->packet->data;
iov[1].iov_len = call->packet->size;
len = writev(call->fd, iov, 2);
h263_printf(10, "< len %d\n", len);