Skip to content
GitLab
Explorer
Connexion
Navigation principale
Rechercher ou aller à…
Projet
Vivy
Gestion
Activité
Membres
Labels
Programmation
Tickets
Tableaux des tickets
Jalons
Wiki
Wiki externe
Code
Requêtes de fusion
Dépôt
Branches
Validations
Étiquettes
Graphe du dépôt
Comparer les révisions
Compilation
Pipelines
Jobs
Planifications de pipeline
Artéfacts
Aide
Aide
Support
Documentation de GitLab
Comparer les forfaits GitLab
Forum de la communauté
Contribuer à GitLab
Donner votre avis
Raccourcis clavier
?
Extraits de code
Groupes
Projets
Afficher davantage de fils d'Ariane
Elliu
Vivy
Validations
cefc9c4f
Valider
cefc9c4f
rédigé
1 year ago
par
Elliu
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
COMPIL: fix libav deprecated warnings
parent
e9d5a723
Aucune branche associée trouvée
Branches contenant la validation
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Modifications
2
Masquer les modifications d'espaces
En ligne
Côte à côte
Affichage de
2 fichiers modifiés
src/Lib/AbstractMediaContext.hh
+1
-1
1 ajout, 1 suppression
src/Lib/AbstractMediaContext.hh
src/Lib/Audio.cc
+9
-11
9 ajouts, 11 suppressions
src/Lib/Audio.cc
avec
10 ajouts
et
12 suppressions
src/Lib/AbstractMediaContext.hh
+
1
−
1
Voir le fichier @
cefc9c4f
...
...
@@ -84,7 +84,7 @@ protected:
VIVY_LOG_CTOR
()
<<
"Codec: "
<<
VIVY_LOG_QUOTED
(
codec
->
name
)
<<
", id: "
<<
codecId
;
VIVY_LOG_CTOR
()
<<
"Sample rate: "
<<
codecParams
->
sample_rate
;
VIVY_LOG_CTOR
()
<<
"Bit rate: "
<<
codecParams
->
bit_rate
;
VIVY_LOG_CTOR
()
<<
"Channels: "
<<
codecParams
->
channels
;
VIVY_LOG_CTOR
()
<<
"Channels: "
<<
codecParams
->
ch_layout
.
nb_
channels
;
}
public
:
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
src/Lib/Audio.cc
+
9
−
11
Voir le fichier @
cefc9c4f
...
...
@@ -31,9 +31,8 @@ AudioStream::AudioStream(const AVCodec *streamCodec, AVFormatContext *formatPtr,
:
Super
(
streamCodec
,
formatPtr
,
streamArg
,
index
)
{
SwrContext
*
s
=
dataSwrContext
.
get
();
av_opt_set_int
(
s
,
"in_channel_count"
,
codecContext
->
channels
,
0
);
av_opt_set_int
(
s
,
"in_channel_count"
,
codecContext
->
ch_layout
.
nb_
channels
,
0
);
av_opt_set_int
(
s
,
"out_channel_count"
,
1
,
0
);
av_opt_set_int
(
s
,
"in_channel_layout"
,
static_cast
<
int64_t
>
(
codecContext
->
channel_layout
),
0
);
av_opt_set_int
(
s
,
"out_channel_layout"
,
AV_CH_LAYOUT_MONO
,
0
);
av_opt_set_int
(
s
,
"in_sample_rate"
,
codecContext
->
sample_rate
,
0
);
av_opt_set_int
(
s
,
"out_sample_rate"
,
resamplerSampleRate
,
0
);
...
...
@@ -59,7 +58,7 @@ AudioStream::getProperties() const noexcept
QJsonObject
ret
=
Super
::
getProperties
();
ret
.
insert
(
"Sample rate"
,
codecParams
->
sample_rate
);
ret
.
insert
(
"Bit rate"
,
static_cast
<
int
>
(
codecParams
->
bit_rate
));
ret
.
insert
(
"Channels"
,
codecParams
->
channels
);
ret
.
insert
(
"Channels"
,
codecParams
->
ch_layout
.
nb_
channels
);
return
ret
;
}
...
...
@@ -71,19 +70,18 @@ AudioStream::decodeData()
throw
std
::
logic_error
(
"audio stream is already resampled"
);
logDebug
()
<<
"Launch decoding of stream "
<<
streamIndexInContext
;
AVPacket
packet
;
av_init_packet
(
&
packet
);
AVPacket
*
packet
=
av_packet_alloc
();;
// Iterate through frames
while
(
av_read_frame
(
dataFormat
,
&
packet
)
>=
0
)
{
while
(
av_read_frame
(
dataFormat
,
packet
)
>=
0
)
{
// Only decode audio
if
(
packet
.
stream_index
!=
streamIndexInContext
)
{
av_packet_unref
(
&
packet
);
if
(
packet
->
stream_index
!=
streamIndexInContext
)
{
av_packet_unref
(
packet
);
continue
;
}
// Decode one frame
int
response
=
avcodec_send_packet
(
codecContext
.
get
(),
&
packet
);
int
response
=
avcodec_send_packet
(
codecContext
.
get
(),
packet
);
if
(
response
<
0
)
{
throw
std
::
runtime_error
(
QStringLiteral
(
"error n°%1 while sending a packet to the decoder"
)
...
...
@@ -135,7 +133,7 @@ AudioStream::decodeData()
}
dataDeleter
(
buffer
);
av_packet_unref
(
&
packet
);
av_packet_unref
(
packet
);
}
logDebug
()
<<
"Decoding data finished for stream "
<<
streamIndexInContext
<<
" with dataPtr "
...
...
@@ -155,7 +153,7 @@ AudioStream::cleanUpData() noexcept
int
AudioStream
::
getChannels
()
const
noexcept
{
return
codecContext
->
channels
;
return
codecContext
->
ch_layout
.
nb_
channels
;
}
// Get the sample rate
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
Aperçu
0%
Chargement en cours
Veuillez réessayer
ou
joindre un nouveau fichier
.
Annuler
You are about to add
0
people
to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Enregistrer le commentaire
Annuler
Veuillez vous
inscrire
ou vous
se connecter
pour commenter