Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vlc-2-2
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-2-2
Commits
0f19b0dc
Commit
0f19b0dc
authored
Apr 06, 2009
by
Antoine Cellerier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add image_Mime2Fourcc() function and use in image_ReadUrl()
parent
3fac9782
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
45 additions
and
0 deletions
+45
-0
include/vlc_image.h
include/vlc_image.h
+1
-0
src/libvlccore.sym
src/libvlccore.sym
+1
-0
src/misc/image.c
src/misc/image.c
+43
-0
No files found.
include/vlc_image.h
View file @
0f19b0dc
...
...
@@ -72,6 +72,7 @@ VLC_EXPORT( void, image_HandlerDelete, ( image_handler_t * ) );
VLC_EXPORT
(
vlc_fourcc_t
,
image_Type2Fourcc
,
(
const
char
*
psz_name
)
);
VLC_EXPORT
(
vlc_fourcc_t
,
image_Ext2Fourcc
,
(
const
char
*
psz_name
)
);
VLC_EXPORT
(
vlc_fourcc_t
,
image_Mime2Fourcc
,
(
const
char
*
psz_mime
)
);
# ifdef __cplusplus
}
...
...
src/libvlccore.sym
View file @
0f19b0dc
...
...
@@ -162,6 +162,7 @@ httpd_UrlNewUnique
image_Ext2Fourcc
__image_HandlerCreate
image_HandlerDelete
image_Mime2Fourcc
image_Type2Fourcc
InitMD5
input_Control
...
...
src/misc/image.c
View file @
0f19b0dc
...
...
@@ -236,6 +236,15 @@ static picture_t *ImageReadUrl( image_handler_t *p_image, const char *psz_url,
p_block
=
block_New
(
p_image
->
p_parent
,
i_size
);
stream_Read
(
p_stream
,
p_block
->
p_buffer
,
i_size
);
if
(
!
p_fmt_in
->
i_chroma
)
{
char
*
psz_mime
=
NULL
;
stream_Control
(
p_stream
,
STREAM_GET_CONTENT_TYPE
,
&
psz_mime
);
if
(
psz_mime
)
p_fmt_in
->
i_chroma
=
image_Mime2Fourcc
(
psz_mime
);
free
(
psz_mime
);
}
stream_Delete
(
p_stream
);
if
(
!
p_fmt_in
->
i_chroma
)
...
...
@@ -576,6 +585,40 @@ static const char *Fourcc2Ext( vlc_fourcc_t i_codec )
}
*/
static
const
struct
{
vlc_fourcc_t
i_codec
;
const
char
*
psz_mime
;
}
mime_table
[]
=
{
{
VLC_FOURCC
(
'b'
,
'm'
,
'p'
,
' '
),
"image/bmp"
},
{
VLC_FOURCC
(
'b'
,
'm'
,
'p'
,
' '
),
"image/x-bmp"
},
{
VLC_FOURCC
(
'b'
,
'm'
,
'p'
,
' '
),
"image/x-bitmap"
},
{
VLC_FOURCC
(
'b'
,
'm'
,
'p'
,
' '
),
"image/x-ms-bmp"
},
{
VLC_FOURCC
(
'p'
,
'n'
,
'm'
,
' '
),
"image/x-portable-anymap"
},
{
VLC_FOURCC
(
'p'
,
'n'
,
'm'
,
' '
),
"image/x-portable-bitmap"
},
{
VLC_FOURCC
(
'p'
,
'n'
,
'm'
,
' '
),
"image/x-portable-graymap"
},
{
VLC_FOURCC
(
'p'
,
'n'
,
'm'
,
' '
),
"image/x-portable-pixmap"
},
{
VLC_FOURCC
(
'g'
,
'i'
,
'f'
,
' '
),
"image/gif"
},
{
VLC_FOURCC
(
'j'
,
'p'
,
'e'
,
'g'
),
"image/jpeg"
},
{
VLC_FOURCC
(
'p'
,
'c'
,
'x'
,
' '
),
"image/pcx"
},
{
VLC_FOURCC
(
'p'
,
'n'
,
'g'
,
' '
),
"image/png"
},
{
VLC_FOURCC
(
't'
,
'i'
,
'f'
,
'f'
),
"image/tiff"
},
{
VLC_FOURCC
(
't'
,
'g'
,
'a'
,
' '
),
"iamge/x-tga"
},
{
VLC_FOURCC
(
'x'
,
'p'
,
'm'
,
' '
),
"image/x-xpixmap"
},
{
0
,
NULL
}
};
vlc_fourcc_t
image_Mime2Fourcc
(
const
char
*
psz_mime
)
{
int
i
;
for
(
i
=
0
;
mime_table
[
i
].
i_codec
;
i
++
)
if
(
!
strcmp
(
psz_mime
,
mime_table
[
i
].
psz_mime
)
)
return
mime_table
[
i
].
i_codec
;
return
0
;
}
static
picture_t
*
video_new_buffer
(
decoder_t
*
p_dec
)
{
p_dec
->
fmt_out
.
video
.
i_chroma
=
p_dec
->
fmt_out
.
i_codec
;
...
...
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