CrystalHD: Always send filtered H.264 stream to hardware.

As we're now always running mp4 format streams through the annex b
filter, it makes sense to pass the filtered stream down, as
libcrystalhd would be doing the conversion internally anyway.

Signed-off-by: Philip Langdale <philipl@overt.org>
This commit is contained in:
Philip Langdale 2011-06-18 11:00:37 -07:00
parent edf5fbd5b2
commit 63e0697294
1 changed files with 13 additions and 9 deletions

View File

@ -794,7 +794,9 @@ static int decode(AVCodecContext *avctx, void *data, int *data_size, AVPacket *a
CopyRet rec_ret;
CHDContext *priv = avctx->priv_data;
HANDLE dev = priv->dev;
uint8_t *in_data = avpkt->data;
int len = avpkt->size;
int free_data = 0;
uint8_t pic_type = 0;
av_log(avctx, AV_LOG_VERBOSE, "CrystalHD: decode_frame\n");
@ -819,15 +821,14 @@ static int decode(AVCodecContext *avctx, void *data, int *data_size, AVPacket *a
int32_t tx_free = (int32_t)DtsTxFreeSize(dev);
if (priv->parser) {
uint8_t *in_data = avpkt->data;
int in_len = len;
int ret = 0;
if (priv->bsfc) {
ret = av_bitstream_filter_filter(priv->bsfc, avctx, NULL,
&in_data, &in_len,
&in_data, &len,
avpkt->data, len, 0);
}
free_data = ret > 0;
if (ret >= 0) {
uint8_t *pout;
@ -836,13 +837,13 @@ static int decode(AVCodecContext *avctx, void *data, int *data_size, AVPacket *a
H264Context *h = priv->parser->priv_data;
index = av_parser_parse2(priv->parser, avctx, &pout, &psize,
in_data, in_len, avctx->pkt->pts,
in_data, len, avctx->pkt->pts,
avctx->pkt->dts, 0);
if (index < 0) {
av_log(avctx, AV_LOG_WARNING,
"CrystalHD: Failed to parse h.264 packet to "
"detect interlacing.\n");
} else if (index != in_len) {
} else if (index != len) {
av_log(avctx, AV_LOG_WARNING,
"CrystalHD: Failed to parse h.264 packet "
"completely. Interlaced frames may be "
@ -859,9 +860,6 @@ static int decode(AVCodecContext *avctx, void *data, int *data_size, AVPacket *a
"packet. Interlaced frames may be incorrectly "
"detected.\n");
}
if (ret > 0) {
av_freep(&in_data);
}
}
if (len < tx_free - 1024) {
@ -876,11 +874,17 @@ static int decode(AVCodecContext *avctx, void *data, int *data_size, AVPacket *a
*/
uint64_t pts = opaque_list_push(priv, avctx->pkt->pts, pic_type);
if (!pts) {
if (free_data) {
av_freep(&in_data);
}
return AVERROR(ENOMEM);
}
av_log(priv->avctx, AV_LOG_VERBOSE,
"input \"pts\": %"PRIu64"\n", pts);
ret = DtsProcInput(dev, avpkt->data, len, pts, 0);
ret = DtsProcInput(dev, in_data, len, pts, 0);
if (free_data) {
av_freep(&in_data);
}
if (ret == BC_STS_BUSY) {
av_log(avctx, AV_LOG_WARNING,
"CrystalHD: ProcInput returned busy\n");