Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
F
ffmpeg.wasm-core
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Linshizhi
ffmpeg.wasm-core
Commits
9bb936a8
Commit
9bb936a8
authored
Aug 13, 2012
by
Nicolas George
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lavc: reimplement avcodec_get_name with descriptors.
parent
690ef618
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
97 deletions
+4
-97
Makefile
libavcodec/Makefile
+0
-8
codec_names.sh
libavcodec/codec_names.sh
+0
-84
utils.c
libavcodec/utils.c
+4
-5
No files found.
libavcodec/Makefile
View file @
9bb936a8
...
...
@@ -785,7 +785,6 @@ OBJS-$(!CONFIG_SMALL) += inverse.o
SKIPHEADERS
+=
%_tablegen.h
\
%_tables.h
\
aac_tablegen_decl.h
\
codec_names.h
\
fft-internal.h
\
old_codec_ids.h
\
tableprint.h
\
...
...
@@ -860,10 +859,3 @@ $(SUBDIR)motionpixels.o: $(SUBDIR)motionpixels_tables.h
$(SUBDIR)pcm.o
:
$(SUBDIR)pcm_tables.h
$(SUBDIR)qdm2.o
:
$(SUBDIR)qdm2_tables.h
endif
CODEC_NAMES_SH
:=
$(SRC_PATH)
/
$(SUBDIR)
codec_names.sh
AVCODEC_H
:=
$(SRC_PATH)
/
$(SUBDIR)
avcodec.h
$(SUBDIR)codec_names.h
:
$(CODEC_NAMES_SH) config.h $(AVCODEC_H)
$(CC)
$(CPPFLAGS)
$(CFLAGS)
-E
$(AVCODEC_H)
|
\
$(CODEC_NAMES_SH)
config.h
$@
$(SUBDIR)utils.o
:
$(SUBDIR)codec_names.h
libavcodec/codec_names.sh
deleted
100755 → 0
View file @
690ef618
#!/bin/sh
# Copyright (c) 2011 Nicolas George
#
# This file is part of FFmpeg.
#
# FFmpeg is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#
# FFmpeg is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with FFmpeg; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
set
-e
config
=
"
$1
"
out
=
"
$2
"
test
-n
"
$out
"
outval
=
""
add_line
()
{
outval
=
"
$outval$*
"
}
parse_config_h
()
{
while
read
define var value
;
do
case
"
$define
$var
$value
"
in
"#define CONFIG_"
*
_
*
" 1"
)
eval
"
$var
=1"
;;
esac
done
}
define_codecid
()
{
id
=
"
$1
"
n
=
${
1
#AV_CODEC_ID_
}
add_line
"case
${
id
}
:"
eval
"c=
\$
{CONFIG_
${
n
}
_DECODER}:
\$
{CONFIG_
${
n
}
_ENCODER}"
case
"
$c
"
in
1:
*
)
s
=
"decoder"
;;
*
:1
)
s
=
"encoder"
;;
*
)
s
=
""
;;
esac
case
"
$s
"
in
""
)
add_line
" return
\"
$n
\"
;"
;;
*
)
add_line
" { extern AVCodec ff_
${
n
}
_
${
s
}
;"
add_line
" return ff_
${
n
}
_
${
s
}
.name; }"
;;
esac
}
parse_enum_codecid
()
{
while
read
line
;
do
case
"
$line
"
in
"};"
)
break
;;
*
AV_CODEC_ID_FIRST
*
=
*
)
;;
AV_CODEC_ID_
*
)
define_codecid
${
line
%%[=,]*
}
;;
esac
done
}
parse_avcodec_h
()
{
while
read
line
;
do
case
"
$line
"
in
"enum AVCodecID {"
)
parse_enum_codecid
;
break
;;
esac
done
}
parse_config_h <
"
$config
"
parse_avcodec_h
# use stdin
sed
-e
'/case.*:/!y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/'
\
-e
's/extern avcodec /extern AVCodec /'
>
"
$out
"
<<
EOF
$outval
EOF
libavcodec/utils.c
View file @
9bb936a8
...
...
@@ -1847,14 +1847,13 @@ AVCodec *avcodec_find_decoder_by_name(const char *name)
const
char
*
avcodec_get_name
(
enum
AVCodecID
id
)
{
const
AVCodecDescriptor
*
cd
;
AVCodec
*
codec
;
#if !CONFIG_SMALL
switch
(
id
)
{
#include "libavcodec/codec_names.h"
}
cd
=
avcodec_descriptor_get
(
id
);
if
(
cd
)
return
cd
->
name
;
av_log
(
NULL
,
AV_LOG_WARNING
,
"Codec 0x%x is not in the full list.
\n
"
,
id
);
#endif
codec
=
avcodec_find_decoder
(
id
);
if
(
codec
)
return
codec
->
name
;
...
...
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