Updated to work with latest ffmpeg.
git-svn-id: http://svn.zoneminder.com/svn/zm/trunk@2256 e3e1d417-86f3-4887-817a-d78f3d33393f
This commit is contained in:
parent
74a92765a4
commit
ea8feae447
|
@ -82,7 +82,7 @@ void VideoStream::SetupCodec( int colours, int width, int height, int bitrate, i
|
||||||
Fatal(( "Could not alloc stream" ));
|
Fatal(( "Could not alloc stream" ));
|
||||||
}
|
}
|
||||||
|
|
||||||
#if ZM_FFMPEG_CVS
|
#if ZM_FFMPEG_SVN
|
||||||
AVCodecContext *c = ost->codec;
|
AVCodecContext *c = ost->codec;
|
||||||
#else
|
#else
|
||||||
AVCodecContext *c = &ost->codec;
|
AVCodecContext *c = &ost->codec;
|
||||||
|
@ -97,7 +97,7 @@ void VideoStream::SetupCodec( int colours, int width, int height, int bitrate, i
|
||||||
/* resolution must be a multiple of two */
|
/* resolution must be a multiple of two */
|
||||||
c->width = width;
|
c->width = width;
|
||||||
c->height = height;
|
c->height = height;
|
||||||
#if ZM_FFMPEG_CVS
|
#if ZM_FFMPEG_SVN
|
||||||
/* time base: this is the fundamental unit of time (in seconds) in terms
|
/* time base: this is the fundamental unit of time (in seconds) in terms
|
||||||
of which frame timestamps are represented. for fixed-fps content,
|
of which frame timestamps are represented. for fixed-fps content,
|
||||||
timebase should be 1/framerate and timestamp increments should be
|
timebase should be 1/framerate and timestamp increments should be
|
||||||
|
@ -155,7 +155,7 @@ void VideoStream::OpenStream()
|
||||||
video codecs and allocate the necessary encode buffers */
|
video codecs and allocate the necessary encode buffers */
|
||||||
if ( ost )
|
if ( ost )
|
||||||
{
|
{
|
||||||
#if ZM_FFMPEG_CVS
|
#if ZM_FFMPEG_SVN
|
||||||
AVCodecContext *c = ost->codec;
|
AVCodecContext *c = ost->codec;
|
||||||
#else
|
#else
|
||||||
AVCodecContext *c = &ost->codec;
|
AVCodecContext *c = &ost->codec;
|
||||||
|
@ -250,7 +250,7 @@ VideoStream::~VideoStream()
|
||||||
/* close each codec */
|
/* close each codec */
|
||||||
if (ost)
|
if (ost)
|
||||||
{
|
{
|
||||||
#if ZM_FFMPEG_CVS
|
#if ZM_FFMPEG_SVN
|
||||||
avcodec_close(ost->codec);
|
avcodec_close(ost->codec);
|
||||||
#else
|
#else
|
||||||
avcodec_close(&ost->codec);
|
avcodec_close(&ost->codec);
|
||||||
|
@ -277,7 +277,11 @@ VideoStream::~VideoStream()
|
||||||
if (!(of->flags & AVFMT_NOFILE))
|
if (!(of->flags & AVFMT_NOFILE))
|
||||||
{
|
{
|
||||||
/* close the output file */
|
/* close the output file */
|
||||||
|
#if ZM_FFMPEG_SVN
|
||||||
|
url_fclose(ofc->pb);
|
||||||
|
#else
|
||||||
url_fclose(&ofc->pb);
|
url_fclose(&ofc->pb);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* free the stream */
|
/* free the stream */
|
||||||
|
@ -301,7 +305,7 @@ double VideoStream::EncodeFrame( uint8_t *buffer, int buffer_size, bool add_time
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#if ZM_FFMPEG_CVS
|
#if ZM_FFMPEG_SVN
|
||||||
AVCodecContext *c = ost->codec;
|
AVCodecContext *c = ost->codec;
|
||||||
#else
|
#else
|
||||||
AVCodecContext *c = &ost->codec;
|
AVCodecContext *c = &ost->codec;
|
||||||
|
|
|
@ -38,10 +38,10 @@ extern "C" {
|
||||||
#if LIBAVCODEC_VERSION_INT < ((50<<16)+(0<<8)+0)
|
#if LIBAVCODEC_VERSION_INT < ((50<<16)+(0<<8)+0)
|
||||||
#define ZM_FFMPEG_049 1
|
#define ZM_FFMPEG_049 1
|
||||||
#else // LIBAVCODEC_VERSION_INT
|
#else // LIBAVCODEC_VERSION_INT
|
||||||
#define ZM_FFMPEG_CVS 1
|
#define ZM_FFMPEG_SVN 1
|
||||||
#endif // LIBAVCODEC_VERSION_INT
|
#endif // LIBAVCODEC_VERSION_INT
|
||||||
#else // FFMPEG_VERSION_INT
|
#else // FFMPEG_VERSION_INT
|
||||||
#define ZM_FFMPEG_CVS 1
|
#define ZM_FFMPEG_SVN 1
|
||||||
#endif // FFMPEG_VERSION_INT
|
#endif // FFMPEG_VERSION_INT
|
||||||
|
|
||||||
class VideoStream
|
class VideoStream
|
||||||
|
|
Loading…
Reference in New Issue