Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Redmine
Redmine
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Metrics
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
videolan
vlc
Commits
968cc6bf
Commit
968cc6bf
authored
Nov 27, 2002
by
Laurent Aimar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* all: added mjpeg support, some clean up in video part.
parent
e0ac4474
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
228 additions
and
66 deletions
+228
-66
modules/codec/ffmpeg/audio.c
modules/codec/ffmpeg/audio.c
+4
-4
modules/codec/ffmpeg/ffmpeg.c
modules/codec/ffmpeg/ffmpeg.c
+30
-4
modules/codec/ffmpeg/ffmpeg.h
modules/codec/ffmpeg/ffmpeg.h
+18
-3
modules/codec/ffmpeg/video.c
modules/codec/ffmpeg/video.c
+172
-53
modules/codec/ffmpeg/video.h
modules/codec/ffmpeg/video.h
+4
-2
No files found.
modules/codec/ffmpeg/audio.c
View file @
968cc6bf
...
...
@@ -2,7 +2,7 @@
* audio.c: audio decoder using ffmpeg library
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: audio.c,v 1.
3 2002/11/14 22:38:47 massiot
Exp $
* $Id: audio.c,v 1.
4 2002/11/27 12:41:45 fenrir
Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
...
...
@@ -196,14 +196,14 @@ void E_( DecodeThread_Audio )( adec_thread_t *p_adec )
if
(
i_frame_size
>
0
)
{
if
(
p_adec
->
i_buffer
<
i_frame_size
+
16
)
if
(
p_adec
->
i_buffer
_size
<
i_frame_size
+
16
)
{
FREE
(
p_adec
->
p_buffer
);
p_adec
->
p_buffer
=
malloc
(
i_frame_size
+
16
);
p_adec
->
i_buffer
=
i_frame_size
+
16
;
p_adec
->
i_buffer
_size
=
i_frame_size
+
16
;
}
E_
(
GetPESData
)(
p_adec
->
p_buffer
,
p_adec
->
i_buffer
,
p_pes
);
E_
(
GetPESData
)(
p_adec
->
p_buffer
,
p_adec
->
i_buffer
_size
,
p_pes
);
}
input_DeletePES
(
p_adec
->
p_fifo
->
p_packets_mgt
,
p_pes
);
}
while
(
i_frame_size
<=
0
);
...
...
modules/codec/ffmpeg/ffmpeg.c
View file @
968cc6bf
...
...
@@ -2,7 +2,7 @@
* ffmpeg.c: video decoder using ffmpeg library
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: ffmpeg.c,v 1.1
7 2002/11/18 02:46:10
fenrir Exp $
* $Id: ffmpeg.c,v 1.1
8 2002/11/27 12:41:45
fenrir Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
...
...
@@ -294,6 +294,10 @@ static int InitThread( generic_thread_t *p_decoder )
}
p_decoder
->
pts
=
0
;
p_decoder
->
p_buffer
=
NULL
;
p_decoder
->
i_buffer
=
0
;
p_decoder
->
i_buffer_size
=
0
;
return
(
i_result
);
}
...
...
@@ -313,7 +317,6 @@ static void EndThread( generic_thread_t *p_decoder )
if
(
p_decoder
->
p_context
!=
NULL
)
{
FREE
(
p_decoder
->
p_context
->
quant_store
);
FREE
(
p_decoder
->
p_context
->
extradata
);
avcodec_close
(
p_decoder
->
p_context
);
msg_Dbg
(
p_decoder
->
p_fifo
,
...
...
@@ -341,7 +344,7 @@ static void EndThread( generic_thread_t *p_decoder )
* locales Functions
*****************************************************************************/
void
E_
(
GetPESData
)(
u8
*
p_buf
,
int
i_max
,
pes_packet_t
*
p_pes
)
int
E_
(
GetPESData
)(
u8
*
p_buf
,
int
i_max
,
pes_packet_t
*
p_pes
)
{
int
i_copy
;
int
i_count
;
...
...
@@ -372,6 +375,7 @@ void E_( GetPESData )( u8 *p_buf, int i_max, pes_packet_t *p_pes )
{
memset
(
p_buf
,
0
,
i_max
-
i_count
);
}
return
(
i_count
);
}
...
...
@@ -386,6 +390,14 @@ static int ffmpeg_GetFfmpegCodec( vlc_fourcc_t i_fourcc,
switch
(
i_fourcc
)
{
#if 0
/* XXX don't use it */
case FOURCC_mpgv:
i_cat = VIDEO_ES;
i_codec = CODEC_ID_MPEG1VIDEO;
psz_name = "MPEG-1/2 Video";
break;
#endif
#if LIBAVCODEC_BUILD >= 4608
case
FOURCC_DIV1
:
case
FOURCC_div1
:
...
...
@@ -479,7 +491,21 @@ static int ffmpeg_GetFfmpegCodec( vlc_fourcc_t i_fourcc,
i_codec
=
CODEC_ID_WMV2
;
psz_name
=
"Windows Media Video 2"
;
break
;
case
FOURCC_MJPG
:
case
FOURCC_mjpg
:
case
FOURCC_mjpa
:
case
FOURCC_jpeg
:
case
FOURCC_JFIF
:
i_cat
=
VIDEO_ES
;
i_codec
=
CODEC_ID_MJPEG
;
psz_name
=
"Motion JPEG"
;
break
;
case
FOURCC_mjpb
:
i_cat
=
VIDEO_ES
;
i_codec
=
CODEC_ID_MJPEGB
;
psz_name
=
"Motion JPEG B"
;
break
;
#if LIBAVCODEC_BUILD >= 4632
case
FOURCC_WMA1
:
case
FOURCC_wma1
:
...
...
modules/codec/ffmpeg/ffmpeg.h
View file @
968cc6bf
...
...
@@ -2,7 +2,7 @@
* ffmpeg_vdec.h: video decoder using ffmpeg library
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: ffmpeg.h,v 1.
8 2002/11/05 10:07:56 gbazin
Exp $
* $Id: ffmpeg.h,v 1.
9 2002/11/27 12:41:45 fenrir
Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
...
...
@@ -37,7 +37,8 @@
\
/* Private stuff for frame gathering */
\
u8 *p_buffer;
/* buffer for gather pes */
\
int i_buffer;
/* size of allocated p_framedata */
int i_buffer_size;
/* size of allocated p_buffer */
\
int i_buffer;
/* bytes already present in p_buffer */
typedef
struct
generic_thread_s
...
...
@@ -55,12 +56,15 @@ typedef struct generic_thread_s
#define FREE( p ) if( p ) free( p ); p = NULL
void
E_
(
GetPESData
)(
u8
*
p_buf
,
int
i_max
,
pes_packet_t
*
p_pes
);
int
E_
(
GetPESData
)(
u8
*
p_buf
,
int
i_max
,
pes_packet_t
*
p_pes
);
/*****************************************************************************
* Video codec fourcc
*****************************************************************************/
/* MPEG 1/2 video */
#define FOURCC_mpgv VLC_FOURCC('m','p','g','v')
/* MPEG4 video */
#define FOURCC_DIVX VLC_FOURCC('D','I','V','X')
#define FOURCC_divx VLC_FOURCC('d','i','v','x')
...
...
@@ -118,6 +122,17 @@ void E_( GetPESData )( u8 *p_buf, int i_max, pes_packet_t *p_pes );
/* Sorenson v1 */
#define FOURCC_SVQ1 VLC_FOURCC( 'S', 'V', 'Q', '1' )
/* mjpeg */
#define FOURCC_MJPG VLC_FOURCC( 'M', 'J', 'P', 'G' )
#define FOURCC_mjpg VLC_FOURCC( 'm', 'j', 'p', 'g' )
/* for mov file */
#define FOURCC_mjpa VLC_FOURCC( 'm', 'j', 'p', 'a' )
/* for mov file XXX: untested */
#define FOURCC_mjpb VLC_FOURCC( 'm', 'j', 'p', 'b' )
#define FOURCC_jpeg VLC_FOURCC( 'j', 'p', 'e', 'g' )
#define FOURCC_JFIF VLC_FOURCC( 'J', 'F', 'I', 'F' )
/* wmv */
#define FOURCC_WMV1 VLC_FOURCC('W','M','V','1')
#define FOURCC_WMV2 VLC_FOURCC('W','M','V','2')
...
...
modules/codec/ffmpeg/video.c
View file @
968cc6bf
This diff is collapsed.
Click to expand it.
modules/codec/ffmpeg/video.h
View file @
968cc6bf
...
...
@@ -2,7 +2,7 @@
* video.h: video decoder using ffmpeg library
*****************************************************************************
* Copyright (C) 1999-2001 VideoLAN
* $Id: video.h,v 1.
3 2002/11/06 21:48:24 gbazin
Exp $
* $Id: video.h,v 1.
4 2002/11/27 12:41:45 fenrir
Exp $
*
* Authors: Laurent Aimar <fenrir@via.ecp.fr>
*
...
...
@@ -37,7 +37,9 @@ typedef struct vdec_thread_s
int
b_hurry_up
;
int
i_frame_error
;
int
i_frame_skip
;
int
i_frame_late
;
/* how many decoded frames are late */
int
i_frame_late
;
/* how many decoded frames are late */
int
i_frame_count
;
/* to emulate pts */
/* for direct rendering */
int
b_direct_rendering
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment