Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
vision
Commits
7fb4ef57
Unverified
Commit
7fb4ef57
authored
Jun 07, 2021
by
Prabhat Roy
Committed by
GitHub
Jun 07, 2021
Browse files
Revert "addressing #3805: remove deprecated function call 3 (#3861)" (#3989)
This reverts commit
f6b6b510
.
parent
4c95bb6e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
6 deletions
+8
-6
torchvision/csrc/io/decoder/audio_stream.cpp
torchvision/csrc/io/decoder/audio_stream.cpp
+4
-4
torchvision/csrc/io/decoder/decoder.cpp
torchvision/csrc/io/decoder/decoder.cpp
+4
-2
No files found.
torchvision/csrc/io/decoder/audio_stream.cpp
View file @
7fb4ef57
...
...
@@ -7,13 +7,13 @@ namespace ffmpeg {
namespace
{
bool
operator
==
(
const
AudioFormat
&
x
,
const
AVFrame
&
y
)
{
return
static_cast
<
int
>
(
x
.
samples
)
==
y
.
sample_rate
&&
static_cast
<
int
>
(
x
.
channels
)
==
y
.
channels
&&
x
.
format
==
y
.
format
;
return
x
.
samples
==
y
.
sample_rate
&&
x
.
channels
==
y
.
channels
&&
x
.
format
==
y
.
format
;
}
bool
operator
==
(
const
AudioFormat
&
x
,
const
AVCodecContext
&
y
)
{
return
static_cast
<
int
>
(
x
.
samples
)
==
y
.
sample_rate
&&
static_cast
<
int
>
(
x
.
channels
)
==
y
.
channels
&&
x
.
format
==
y
.
sample_fmt
;
return
x
.
samples
==
y
.
sample_rate
&&
x
.
channels
==
y
.
channels
&&
x
.
format
==
y
.
sample_fmt
;
}
AudioFormat
&
toAudioFormat
(
AudioFormat
&
x
,
const
AVFrame
&
y
)
{
...
...
torchvision/csrc/io/decoder/decoder.cpp
View file @
7fb4ef57
...
...
@@ -196,6 +196,8 @@ int64_t Decoder::seekCallback(int64_t offset, int whence) {
void
Decoder
::
initOnce
()
{
static
std
::
once_flag
flagInit
;
std
::
call_once
(
flagInit
,
[]()
{
av_register_all
();
avcodec_register_all
();
avformat_network_init
();
// register ffmpeg lock manager
av_lockmgr_register
(
&
ffmpeg_lock
);
...
...
@@ -395,10 +397,10 @@ bool Decoder::init(
}
bool
Decoder
::
openStreams
(
std
::
vector
<
DecoderMetadata
>*
metadata
)
{
for
(
int
i
=
0
;
i
<
static_cast
<
int
>
(
inputCtx_
->
nb_streams
)
;
i
++
)
{
for
(
int
i
=
0
;
i
<
inputCtx_
->
nb_streams
;
i
++
)
{
// - find the corespondent format at params_.formats set
MediaFormat
format
;
const
auto
media
=
inputCtx_
->
streams
[
i
]
->
codec
par
->
codec_type
;
const
auto
media
=
inputCtx_
->
streams
[
i
]
->
codec
->
codec_type
;
if
(
!
mapFfmpegType
(
media
,
&
format
.
type
))
{
VLOG
(
1
)
<<
"Stream media: "
<<
media
<<
" at index "
<<
i
<<
" gets ignored, unknown type"
;
...
...
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