From 1abced42eb3997ef9ef675bfe990f7913ea73f2f Mon Sep 17 00:00:00 2001 From: houxiao <houxiao@454eff88-639b-444f-9e54-f578c98de674> Date: 星期五, 23 十二月 2016 18:34:10 +0800 Subject: [PATCH] add h264 encoder and rtsp server --- RtspFace/PL_H264Decoder.cpp | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/RtspFace/PL_H264Decoder.cpp b/RtspFace/PL_H264Decoder.cpp index 9f51b43..879fa6f 100644 --- a/RtspFace/PL_H264Decoder.cpp +++ b/RtspFace/PL_H264Decoder.cpp @@ -126,7 +126,7 @@ in->pAVCodecContext->codec_type = AVMEDIA_TYPE_VIDEO; in->pAVCodecContext->bit_rate = 0; in->pAVCodecContext->time_base.den = 25; - in->pAVCodecContext->width = 1920; + in->pAVCodecContext->width = 1920;//#todo get from pm in->pAVCodecContext->height = 1080; if (in->pAVCodecContext->extradata == NULL) @@ -159,7 +159,7 @@ bool decodeH264(H264Decoder_Internal* in, uint8_t* buffer, size_t buffSize) { AVPacket packet = {0}; - int frameFinished = buffSize; + int gotPicture = buffSize; // frameFinished if (av_packet_from_data(&packet, buffer, buffSize) != 0) { @@ -168,8 +168,8 @@ } // decode - avcodec_decode_video2(in->pAVCodecContext, in->pAVFrame, &frameFinished, &packet); - if(frameFinished) + avcodec_decode_video2(in->pAVCodecContext, in->pAVFrame, &gotPicture, &packet); + if(gotPicture) { // decode ok return true; -- Gitblit v1.8.0