3 *****************************************************************************
4 * Copyright © 2015 VideoLAN and VLC Authors
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU Lesser General Public License as published
8 * by the Free Software Foundation; either version 2.1 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public License
17 * along with this program; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
19 *****************************************************************************/
25 #include "FakeESOutID.hpp"
26 #include "FakeESOut.hpp"
28 using namespace adaptive
;
30 FakeESOutID::FakeESOutID( FakeESOut
*fakeesout
, const es_format_t
*p_fmt
)
31 : fakeesout( fakeesout
)
32 , p_real_es_id( NULL
)
33 , pending_delete( false )
35 es_format_Copy( &fmt
, p_fmt
);
38 FakeESOutID::~FakeESOutID()
40 es_format_Clean( &fmt
);
43 void FakeESOutID::setRealESID( es_out_id_t
*real_es_id
)
45 p_real_es_id
= real_es_id
;
48 void FakeESOutID::notifyData()
53 void FakeESOutID::create()
55 fakeesout
->createOrRecycleRealEsID( this );
58 void FakeESOutID::release()
60 fakeesout
->recycle( this );
63 es_out_id_t
* FakeESOutID::realESID()
68 const es_format_t
*FakeESOutID::getFmt() const
73 bool FakeESOutID::isCompatible( const FakeESOutID
*p_other
) const
75 if( p_other
->fmt
.i_cat
!= fmt
.i_cat
)
86 if(fmt
.i_cat
== AUDIO_ES
)
88 /* Reject audio streams with different or unknown rates */
89 if(fmt
.audio
.i_rate
!= p_other
->fmt
.audio
.i_rate
|| !fmt
.audio
.i_rate
)
93 return es_format_IsSimilar( &p_other
->fmt
, &fmt
) &&
94 !p_other
->fmt
.i_extra
&& !fmt
.i_extra
;
98 void FakeESOutID::setScheduledForDeletion()
100 pending_delete
= true;
103 bool FakeESOutID::scheduledForDeletion() const
105 return pending_delete
;