Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • videolan/vlc
  • chouquette/vlc
  • bakiewicz.marek122/vlc
  • devnexen/vlc
  • rohanrajpal/vlc
  • blurrrb/vlc
  • gsoc/gsoc2019/darkapex/vlc
  • b1ue/vlc
  • fkuehne/vlc
  • magsoft/vlc
  • chub/vlc
  • cramiro9/vlc
  • robUx4/vlc
  • rom1v/vlc
  • akshayaky/vlc
  • tmk907/vlc
  • akymaster/vlc
  • govind.sharma/vlc
  • psilokos/vlc
  • xjbeta/vlc
  • jahan/vlc
  • 1480c1/vlc
  • amanchande/vlc
  • aaqib/vlc
  • rist/vlc
  • apol/vlc
  • mindfreeze/vlc
  • alexandre-janniaux/vlc
  • sandsmark/vlc
  • jagannatharjun/vlc
  • gsoc/gsoc2020/matiaslgonzalez/vlc
  • gsoc/gsoc2020/jagannatharjun/vlc
  • mstorsjo/vlc
  • gsoc/gsoc2020/vedenta/vlc
  • gsoc/gsoc2020/arnav-ishaan/vlc
  • gsoc/gsoc2020/andreduong/vlc
  • fuzun/vlc
  • gsoc/gsoc2020/vatsin/vlc
  • gsoc/gsoc2020/sagid/vlc
  • yaron/vlc
  • Phoenix/vlc
  • Garf/vlc
  • ePiratWorkarounds/vlc
  • tguillem/vlc
  • jnqnfe/vlc
  • mdc/vlc
  • Vedaa/vlc
  • rasa/vlc
  • quink/vlc
  • yealo/vlc
  • aleksey_ak/vlc
  • ePirat/vlc
  • ilya.yanok/vlc
  • asenat/vlc
  • m/vlc
  • bunjee/vlc
  • BLumia/vlc
  • sagudev/vlc
  • hamedmonji30/vlc
  • nullgemm/vlc
  • DivyamAhuja/vlc
  • thesamesam/vlc
  • dag7/vlc
  • snehil101/vlc
  • haasn/vlc
  • jbk/vlc
  • ValZapod/vlc
  • mfkl/vlc
  • WangChuan/vlc
  • core1024/vlc
  • GhostVaibhav/vlc
  • dfuhrmann/vlc
  • davide.prade/vlc
  • tmatth/vlc
  • Courmisch/vlc
  • zouya/vlc
  • hpi/vlc
  • EwoutH/vlc
  • aleung27/vlc
  • hengwu0/vlc
  • saladin/vlc
  • ashuio/vlc
  • richselwood/vlc
  • verma16Ayush/vlc
  • chemicalflash/vlc
  • PoignardAzur/vlc
  • huangjieNT/vlc
  • Blake-Haydon/vlc
  • AnuthaDev/vlc
  • gsoc/gsoc2021/mpd/vlc
  • nicolas_lequec/vlc
  • sambassaly/vlc
  • thresh/vlc
  • bonniegong/vlc
  • myaashish/vlc
  • stavros.vagionitis/vlc
  • ileoo/vlc
  • louis-santucci/vlc
  • cchristiansen/vlc
  • sabyasachi07/vlc
  • AbduAmeen/vlc
  • ashishb0410/vlc
  • urbanhusky/vlc
  • davidepietrasanta/vlc
  • riksleutelstad/vlc
  • jeremyVignelles/vlc
  • komh/vlc
  • iamjithinjohn/vlc
  • JohannesKauffmann/vlc2
  • kunglao/vlc
  • natzberg/vlc
  • jill/vlc
  • cwendling/vlc
  • adufou/vlc
  • ErwanAirone/vlc
  • HasinduDilshan10/vlc
  • vagrantc/vlc
  • rafiv/macos-bigsur-icon
  • Aymeriic/vlc
  • saranshg20/vlc
  • metzlove24/vlc
  • linkfanel/vlc
  • Ds886/vlc
  • metehan-arslan/vlc
  • Skantes/vlc
  • kgsandundananjaya96/vlc
  • mitchcapper/vlc
  • advaitgupta/vlc
  • StefanBruens/vlc
  • ratajs/vlc
  • T.M.F.B.3761/vlc
  • m222059/vlc
  • casemerrick/vlc
  • joshuaword2alt/vlc
  • sjwaddy/vlc
  • dima/vlc
  • Ybalrid/vlc
  • umxprime/vlc
  • eschmidt/vlc
  • vannieuwenhuysenmichelle/vlc
  • badcf00d/vlc
  • wesinator/vlc
  • louis/vlc
  • xqq/vlc
  • EmperorYP7/vlc
  • NicoLiam/vlc
  • loveleen/vlc
  • rofferom/vlc
  • rbultje/vlc
  • TheUnamed/vlc
  • pratiksharma341/vlc
  • Saurab17/vlc
  • purist.coder/vlc
  • Shuicheng/vlc
  • mdrrubel292/vlc
  • silverbleu00/vlc
  • metif12/vlc
  • asher-m/vlc
  • jeffk/vlc
  • Brandonbr1/vlc
  • beautyyuyanli/vlc
  • rego21/vlc
  • muyangren907/vlc
  • collectionbylawrencejason/vlc
  • evelez/vlc
  • GSMgeeth/vlc
  • Oneric/vlc
  • TJ5/vlc
  • XuanTung95/vlc
  • darrenjenny21/vlc
  • Trenly/vlc
  • RockyTDR/vlc
  • mjakubowski/vlc
  • caprica/vlc
  • ForteFrankie/vlc
  • seannamiller19/vlc
  • junlon2006/vlc
  • kiwiren6666/vlc
  • iuseiphonexs/vlc
  • fenngtun/vlc
  • Rajdutt999/vlc
  • typx/vlc
  • leon.vitanos/vlc
  • robertogarci0938/vlc
  • gsoc/gsoc2022/luc65r/vlc-mpd
  • skeller/vlc
  • MCJack123/vlc
  • luc65r/vlc-mpd
  • popov895/vlc
  • claucambra/vlc
  • brad/vlc
  • matthewmurua88/vlc
  • Tomas8874/vlc
  • philenotfound/vlc
  • makita-do3/vlc
  • LZXCorp/vlc
  • mar0x/vlc
  • senojetkennedy0102/vlc
  • shaneb243/vlc
  • ahmadbader/vlc
  • rajduttcse26/vlc-audio-filters
  • Juniorzito8415/vlc
  • achernyakov/vlc
  • lucasjetgroup/vlc
  • pupdoggy666/vlc
  • gmde9363/vlc
  • alexnwayne/vlc
  • bahareebrahimi781/vlc
  • hamad633666/vlc
  • umghof3112/vlc
  • joe0199771874/vlc
  • Octocats66666666/vlc
  • jjm_223/vlc
  • btech10110.19/vlc
  • sunnykfc028/vlc-audio-filters
  • loic/vlc
  • nguyenminhducmx1/vlc
  • JanekKrueger/vlc
  • bstubbington2/vlc
  • rcombs/vlc
  • Ordissimo/vlc
  • king7532/vlc
  • noobsauce101/vlc
  • schong0525/vlc
  • myQwil/vlc
  • apisbg91/vlc
  • geeboy0101017/vlc
  • kim.faughey/vlc
  • nurupo/vlc
  • yyusea/vlc
  • 0711235879.khco/vlc
  • ialo/vlc
  • iloveyeye2/vlc
  • gdtdftdqtd/vlc
  • leandroconsiglio/vlc
  • AndyHTML2012/vlc
  • ncz/vlc
  • lucenticus/vlc
  • knr1931/vlc
  • kjoonlee/vlc
  • chandrakant100/vlc-qt
  • johge42/vlc
  • polter/vlc
  • hexchain/vlc
  • Tushwrld/vlc
  • mztea928/vlc
  • jbelloncastro/vlc
  • alvinhochun/vlc
  • ghostpiratecrow/vlc
  • ujjwaltwitx/vlc
  • alexsonarin06/vlc
  • adrianbon76/vlc
  • altsod/vlc
  • damien.lucas44/vlc
  • dmytrivtaisa/vlc
  • utk202/vlc
  • aaxhrj/vlc
  • thomas.hermes/vlc
  • structurenewworldorder/vlc
  • slomo/vlc
  • wantlamy/vlc
  • musc.o3cminc/vlc
  • thebarshablog/vlc
  • kerrick/vlc
  • kratos142518/vlc
  • leogps/vlc
  • vacantron/vlc
  • luna_koly/vlc
  • Ratio2/vlc
  • anuoshemohammad/vlc
  • apsun/vlc
  • aaa1115910/vlc
  • alimotmoyo/vlc
  • Ambossmann/vlc
  • Sam-LearnsToCode/vlc
  • Chilledheart/vlc
  • Labnann/vlc
  • ktcoooot1/vlc
  • mohit-marathe/vlc
  • johnddx/vlc
  • manstabuk/vlc
  • Omar-ahmed314/vlc
  • vineethkm/vlc
  • 9Enemi86/vlc
  • radoslav.m.panteleev/vlc
  • ashishami2002/vlc
  • Corbax/vlc
  • firnasahmed/vlc
  • pelayarmalam4/vlc
  • c0ff330k/vlc
  • shikhindahikar/vlc
  • l342723951/vlc
  • christianschwandner/vlc
  • douniwan5788/vlc
  • 7damian7/vlc
  • ferdnyc/vlc
  • f.ales1/vlc
  • pandagby/vlc
  • BaaBaa/vlc
  • jewe37/vlc
  • w00drow/vlc
  • russelltg/vlc
  • ironicallygod/vlc
  • soumyaDghosh/vlc
  • linzihao1999/vlc
  • deyayush6/vlc
  • mibi88/vlc
  • newabdallah10/vlc
  • jhorbincolombia/vlc
  • rimvihaqueshupto/vlc
  • andrewkhon98/vlc
  • fab78/vlc
  • lapaz17/vlc
  • amanna13/vlc
  • mdakram28/vlc
  • 07jw1980/vlc
  • sohamgupta/vlc
  • Eson-Jia1/vlc
  • Sumou/vlc
  • vikram-kangotra/vlc
  • chalice191/vlc
  • olivercalder/vlc
  • aaasg4001/vlc
  • zipdox/vlc
  • kwizart/vlc
  • Dragon-S/vlc
  • jdemeule/vlc
  • gabriel_lt/vlc
  • locutusofborg/vlc
  • sammirata/vlc-librist
  • another/vlc
  • Benjamin_Loison/vlc
  • ahmedmoselhi/vlc
  • petergaal/vlc
  • huynhsontung/vlc
  • dariusmihut/vlc
  • tvermaashutosh/vlc
  • buti/vlc
  • Niram7777/vlc
  • rohan-here/vlc
  • balaji-sivasakthi/vlc
  • rlindner81/vlc
  • Kakadus/vlc
  • djain/vlc
  • ABBurmeister/vlc
  • craighuggins/vlc
  • orbea/vlc
  • maxos/vlc
  • aakarshmj/vlc
  • kblaschke/vlc
  • ankitm/vlc
  • advait-0/vlc
  • mohak2003/vlc
  • yselkowitz/vlc
  • AZM999/vlc-azm
  • andrey.turkin/vlc
  • Disha-Baghel/vlc
  • nowrep/vlc
  • Apeng/vlc
  • Choucroute_melba/vlc
  • autra/vlc
  • eclipseo/vlc
  • fhuber/vlc
  • olafhering/vlc
  • sdasda7777/vlc
  • 1div0/vlc
  • skosnits/vlc-extended-playlist-support
  • dnicolson/vlc
  • Timshel/vlc
  • octopols/vlc
  • MangalK/vlc
  • nima64/vlc
  • misawai/vlc
  • Alexander-Wilms/vlc
  • Maxime2/vlc-fork-for-visualizer
  • ww/vlc
  • jeske/vlc
  • sgross-emlix/vlc
  • morenonatural/vlc
  • freakingLovesVLC/vlc
  • borisgolovnev/vlc
  • mpromonet/vlc
  • diogo.simao-marques/vlc
  • masstock/vlc
  • pratikpatel8982/vlc
  • hugok79/vlc
  • longervision/vlc
  • abhiudaysurya/vlc
  • rishabhgarg/vlc
  • tumic/vlc
  • cart/vlc
  • shubham442/vlc
  • Aditya692005/vlc
  • sammirata/vlc4
  • syrykh/vlc
  • Vvorcun/macos-new-icon
  • AyaanshC/vlc
  • nasso/vlc
  • Quark/vlc
  • sebastinas/vlc
  • rhstone/vlc
  • talregev/vlc
  • Managor/vlc
403 results
Show changes
Commits on Source (13)
......@@ -104,29 +104,4 @@ VLC_API picture_t * picture_pool_Get( picture_pool_t * ) VLC_USED;
*/
VLC_API picture_t *picture_pool_Wait(picture_pool_t *) VLC_USED;
/**
* Reserves pictures from a pool and creates a new pool with those.
*
* When the new pool is released, pictures are returned to the master pool.
* If the master pool was already released, pictures will be destroyed.
*
* @param pool A pool from ::picture_pool_New or ::picture_pool_NewFromFormat
* @param count number of picture to reserve
*
* @return the new pool, or NULL if there were not enough pictures available
* or on error
*
* @note This function is thread-safe (but it might return NULL if other
* threads have already allocated too many pictures).
*/
VLC_API picture_pool_t * picture_pool_Reserve(picture_pool_t *pool, unsigned count)
VLC_USED;
/**
* @return the total number of pictures in the given pool
* @note This function is thread-safe.
*/
unsigned picture_pool_GetSize(const picture_pool_t *);
#endif /* VLC_PICTURE_POOL_H */
......@@ -335,7 +335,6 @@ picture_pool_Release
picture_pool_Get
picture_pool_New
picture_pool_NewFromFormat
picture_pool_Reserve
picture_pool_Wait
picture_Reset
picture_Setup
......
......@@ -153,34 +153,6 @@ error:
return NULL;
}
picture_pool_t *picture_pool_Reserve(picture_pool_t *master, unsigned count)
{
if (count == 0)
vlc_assert_unreachable();
if (unlikely(count > POOL_MAX))
return NULL;
picture_t *picture[POOL_MAX];
unsigned i;
for (i = 0; i < count; i++) {
picture[i] = picture_pool_Get(master);
if (picture[i] == NULL)
goto error;
}
picture_pool_t *pool = picture_pool_New(count, picture);
if (!pool)
goto error;
return pool;
error:
while (i > 0)
picture_Release(picture[--i]);
return NULL;
}
picture_t *picture_pool_Get(picture_pool_t *pool)
{
......@@ -214,8 +186,3 @@ picture_t *picture_pool_Wait(picture_pool_t *pool)
return picture_pool_ClonePicture(pool, i);
}
unsigned picture_pool_GetSize(const picture_pool_t *pool)
{
return pool->picture_count;
}
......@@ -35,7 +35,7 @@
const char vlc_module_name[] = "test_picture_pool";
static video_format_t fmt;
static picture_pool_t *pool, *reserve;
static picture_pool_t *pool;
static void test(bool zombie)
{
......@@ -52,9 +52,6 @@ static void test(bool zombie)
for (unsigned i = 0; i < PICTURES; i++)
assert(picture_pool_Get(pool) == NULL);
// Reserve currently assumes that all pictures are free (or reserved).
//assert(picture_pool_Reserve(pool, 1) == NULL);
for (unsigned i = 0; i < PICTURES / 2; i++)
picture_Hold(pics[i]);
......@@ -79,28 +76,10 @@ static void test(bool zombie)
assert(pics[i] != NULL);
}
for (unsigned i = 0; i < PICTURES; i++)
picture_Release(pics[i]);
reserve = picture_pool_Reserve(pool, PICTURES / 2);
assert(reserve != NULL);
for (unsigned i = 0; i < PICTURES / 2; i++) {
pics[i] = picture_pool_Get(pool);
assert(pics[i] != NULL);
}
for (unsigned i = PICTURES / 2; i < PICTURES; i++) {
assert(picture_pool_Get(pool) == NULL);
pics[i] = picture_pool_Get(reserve);
assert(pics[i] != NULL);
}
if (!zombie)
for (unsigned i = 0; i < PICTURES; i++)
picture_Release(pics[i]);
picture_pool_Release(reserve);
picture_pool_Release(pool);
if (zombie)
......@@ -115,10 +94,6 @@ int main(void)
pool = picture_pool_NewFromFormat(&fmt, PICTURES);
assert(pool != NULL);
reserve = picture_pool_Reserve(pool, PICTURES / 2);
assert(reserve != NULL);
picture_pool_Release(reserve);
picture_pool_Release(pool);
test(false);
......
......@@ -243,7 +243,7 @@ typedef struct {
/* filters to convert the vout source to fmt, NULL means no conversion
* can be done and nothing will be displayed */
filter_chain_t *converters;
picture_pool_t *pool;
picture_pool_t *converter_pool;
} vout_display_priv_t;
/*****************************************************************************
......@@ -259,8 +259,7 @@ static picture_t *VideoBufferNew(filter_t *filter)
osys->display_fmt.i_width == fmt->i_width &&
osys->display_fmt.i_height == fmt->i_height);
assert(picture_pool_GetSize(osys->pool) >= 3);
return picture_pool_Get(osys->pool);
return picture_pool_Get(osys->converter_pool);
}
static vlc_decoder_device * DisplayHoldDecoderDevice(vlc_object_t *o, void *sys)
......@@ -283,10 +282,6 @@ static int VoutDisplayCreateRender(vout_display_t *vd)
.sys = vd,
};
osys->converters = filter_chain_NewVideo(vd, false, &owner);
if (unlikely(osys->converters == NULL))
return VLC_ENOMEM;
video_format_t v_src = osys->source;
v_src.i_sar_num = 0;
v_src.i_sar_den = 0;
......@@ -299,6 +294,23 @@ static int VoutDisplayCreateRender(vout_display_t *vd)
if (!convert)
return VLC_SUCCESS;
assert(osys->converter_pool == NULL);
// 1 for current converter + 1 for previously displayed
osys->converter_pool = picture_pool_NewFromFormat(&osys->display_fmt, 1+1);
if (osys->converter_pool == NULL)
{
msg_Err(vd, "Failed to allocate converter pool");
return VLC_ENOMEM;
}
osys->converters = filter_chain_NewVideo(vd, false, &owner);
if (unlikely(osys->converters == NULL))
{
picture_pool_Release(osys->converter_pool);
osys->converter_pool = NULL;
return VLC_ENOMEM;
}
msg_Dbg(vd, "A filter to adapt decoder %4.4s to display %4.4s is needed",
(const char *)&v_src.i_chroma, (const char *)&v_dst.i_chroma);
......@@ -319,6 +331,9 @@ static int VoutDisplayCreateRender(vout_display_t *vd)
msg_Err(vd, "Failed to adapt decoder format to display");
filter_chain_Delete(osys->converters);
osys->converters = NULL;
picture_pool_Release(osys->converter_pool);
osys->converter_pool = NULL;
}
return ret;
}
......@@ -348,33 +363,12 @@ static void VoutDisplayCropRatio(unsigned *left, unsigned *top, unsigned *right,
}
}
/**
* It retrieves a picture pool from the display
*/
picture_pool_t *vout_GetPool(vout_display_t *vd, unsigned count)
{
vout_display_priv_t *osys = container_of(vd, vout_display_priv_t, display);
if (osys->pool == NULL)
osys->pool = picture_pool_NewFromFormat(&osys->display_fmt, count);
return osys->pool;
}
bool vout_IsDisplayFiltered(vout_display_t *vd)
{
vout_display_priv_t *osys = container_of(vd, vout_display_priv_t, display);
return osys->converters == NULL || !filter_chain_IsEmpty(osys->converters);
}
picture_t *vout_ConvertForDisplay(vout_display_t *vd, picture_t *picture)
{
vout_display_priv_t *osys = container_of(vd, vout_display_priv_t, display);
if (osys->converters == NULL) {
picture_Release(picture);
return NULL;
}
if (osys->converters == NULL)
return picture;
return filter_chain_VideoFilter(osys->converters, picture);
}
......@@ -407,9 +401,9 @@ static void vout_display_Reset(vout_display_t *vd)
osys->converters = NULL;
}
if (osys->pool != NULL) {
picture_pool_Release(osys->pool);
osys->pool = NULL;
if (osys->converter_pool != NULL) {
picture_pool_Release(osys->converter_pool);
osys->converter_pool = NULL;
}
assert(vd->ops->reset_pictures);
......@@ -664,7 +658,14 @@ int vout_SetDisplayFormat(vout_display_t *vd, const video_format_t *fmt,
/* On update_format success, the vout display accepts the target format, so
* no display converters are needed. */
filter_chain_Clear(osys->converters);
if (osys->converters != NULL)
{
filter_chain_Delete(osys->converters);
osys->converters = NULL;
assert(osys->converter_pool != NULL);
picture_pool_Release(osys->converter_pool);
osys->converter_pool = NULL;
}
return VLC_SUCCESS;
}
......@@ -691,7 +692,7 @@ vout_display_t *vout_display_New(vlc_object_t *parent,
source, &cfg->display);
}
osys->pool = NULL;
osys->converter_pool = NULL;
video_format_Copy(&osys->source, source);
osys->crop.mode = VOUT_CROP_NONE;
......@@ -767,8 +768,8 @@ void vout_display_Delete(vout_display_t *vd)
if (osys->converters != NULL)
filter_chain_Delete(osys->converters);
if (osys->pool != NULL)
picture_pool_Release(osys->pool);
if (osys->converter_pool != NULL)
picture_pool_Release(osys->converter_pool);
if (vd->ops->close != NULL)
vd->ops->close(vd);
......
......@@ -91,13 +91,13 @@ static int DeinterlaceCallback(vlc_object_t *object, char const *cmd,
return VLC_SUCCESS;
}
void vout_InitInterlacingSupport(vout_thread_t *vout, vout_thread_private_t *sys)
void vout_InitInterlacingSupport(vout_thread_t *vout, vout_interlacing_state_t *sys)
{
vlc_value_t val;
msg_Dbg(vout, "Deinterlacing available");
sys->interlacing.has_deint = false;
sys->has_deint = false;
/* Create the configuration variables */
/* */
......@@ -147,31 +147,31 @@ void vout_InitInterlacingSupport(vout_thread_t *vout, vout_thread_private_t *sys
var_Create(vout, "sout-deinterlace-mode", VLC_VAR_STRING);
sys->interlacing.is_interlaced = false;
sys->is_interlaced = false;
}
void vout_ReinitInterlacingSupport(vout_thread_t *vout, vout_thread_private_t *sys)
void vout_ReinitInterlacingSupport(vout_thread_t *vout, vout_interlacing_state_t *sys)
{
sys->interlacing.is_interlaced = false;
sys->is_interlaced = false;
var_SetBool(vout, "deinterlace-needed", false);
}
void vout_SetInterlacingState(vout_thread_t *vout, vout_thread_private_t *sys, bool is_interlaced)
void vout_SetInterlacingState(vout_thread_t *vout, vout_interlacing_state_t *sys, bool is_interlaced)
{
const bool interlacing_change =
is_interlaced != sys->interlacing.is_interlaced;
is_interlaced != sys->is_interlaced;
/* Wait 30s before quitting interlacing mode */
const bool is_after_deadline =
sys->interlacing.date + VLC_TICK_FROM_SEC(30) < vlc_tick_now();
sys->date + VLC_TICK_FROM_SEC(30) < vlc_tick_now();
if (interlacing_change && (is_interlaced || is_after_deadline))
{
msg_Dbg(vout, "Detected %s video",
is_interlaced ? "interlaced" : "progressive");
var_SetBool(vout, "deinterlace-needed", is_interlaced);
sys->interlacing.is_interlaced = is_interlaced;
sys->is_interlaced = is_interlaced;
}
if (is_interlaced)
sys->interlacing.date = vlc_tick_now();
sys->date = vlc_tick_now();
}
......@@ -69,7 +69,7 @@ typedef struct vout_thread_sys_t
{
struct vout_thread_t obj;
vout_thread_private_t private;
vout_interlacing_state_t interlacing;
bool dummy;
......@@ -169,6 +169,7 @@ typedef struct vout_thread_sys_t
vlc_atomic_rc_t rc;
picture_pool_t *private_pool; // interactive + static filters & blending
} vout_thread_sys_t;
#define VOUT_THREAD_TO_SYS(vout) \
......@@ -734,7 +735,7 @@ static picture_t *VoutVideoFilterInteractiveNewPicture(filter_t *filter)
{
vout_thread_sys_t *sys = filter->owner.sys;
picture_t *picture = picture_pool_Get(sys->private.private_pool);
picture_t *picture = picture_pool_Get(sys->private_pool);
if (picture) {
picture_Reset(picture);
video_format_CopyCropAr(&picture->format, &filter->fmt_out.video);
......@@ -789,7 +790,7 @@ static void ChangeFilters(vout_thread_sys_t *vout)
vlc_array_init(&array_static);
vlc_array_init(&array_interactive);
if (sys->private.interlacing.has_deint)
if (sys->interlacing.has_deint)
{
vout_filter_t *e = malloc(sizeof(*e));
......@@ -1197,7 +1198,7 @@ static int PrerenderPicture(vout_thread_sys_t *sys, picture_t *filtered,
picture_t *snap_pic = todisplay;
if (!vd_does_blending && blending_before_converter && subpic) {
if (sys->spu_blend) {
picture_t *blent = picture_pool_Get(sys->private.private_pool);
picture_t *blent = picture_pool_Get(sys->private_pool);
if (blent) {
video_format_CopyCropAr(&blent->format, &filtered->format);
picture_Copy(blent, filtered);
......@@ -1393,9 +1394,9 @@ static void UpdateDeinterlaceFilter(vout_thread_sys_t *sys)
{
vlc_mutex_lock(&sys->filter.lock);
if (sys->filter.changed ||
sys->private.interlacing.has_deint != sys->filter.new_interlaced)
sys->interlacing.has_deint != sys->filter.new_interlaced)
{
sys->private.interlacing.has_deint = sys->filter.new_interlaced;
sys->interlacing.has_deint = sys->filter.new_interlaced;
ChangeFilters(sys);
}
vlc_mutex_unlock(&sys->filter.lock);
......@@ -1663,7 +1664,7 @@ static int vout_Start(vout_thread_sys_t *vout, vlc_video_context *vctx, const vo
vlc_mutex_unlock(&sys->window_lock);
sys->decoder_fifo = picture_fifo_New();
sys->private.private_pool = NULL;
sys->private_pool = NULL;
sys->filter.configuration = NULL;
video_format_Copy(&sys->filter.src_fmt, &sys->original);
......@@ -1719,7 +1720,18 @@ static int vout_Start(vout_thread_sys_t *vout, vlc_video_context *vctx, const vo
dcfg.display.width = sys->window_width;
dcfg.display.height = sys->window_height;
sys->display = vout_OpenWrapper(&vout->obj, &sys->private, sys->splitter_name, &dcfg,
const unsigned private_picture = 4; /* XXX 3 for filter, 1 for SPU */
const unsigned kept_picture = 1; /* last displayed picture */
sys->private_pool =
picture_pool_NewFromFormat(&sys->original,
private_picture + kept_picture);
if (sys->private_pool == NULL) {
vlc_queuedmutex_unlock(&sys->display_lock);
goto error;
}
sys->display = vout_OpenWrapper(&vout->obj, sys->splitter_name, &dcfg,
&sys->original, vctx);
if (sys->display == NULL) {
vlc_queuedmutex_unlock(&sys->display_lock);
......@@ -1732,8 +1744,6 @@ static int vout_Start(vout_thread_sys_t *vout, vlc_video_context *vctx, const vo
vout_SetDisplayAspect(sys->display, num, den);
vlc_queuedmutex_unlock(&sys->display_lock);
assert(sys->private.private_pool != NULL);
sys->displayed.current = NULL;
sys->displayed.decoded = NULL;
sys->displayed.date = VLC_TICK_INVALID;
......@@ -1760,6 +1770,11 @@ error:
filter_chain_Delete(ci);
if (cs != NULL)
filter_chain_Delete(cs);
if (sys->private_pool)
{
picture_pool_Release(sys->private_pool);
sys->private_pool = NULL;
}
video_format_Clean(&sys->filter.src_fmt);
if (sys->filter.src_vctx)
{
......@@ -1810,7 +1825,7 @@ static void *Thread(void *object)
const bool picture_interlaced = sys->displayed.is_interlaced;
vout_SetInterlacingState(&vout->obj, &sys->private, picture_interlaced);
vout_SetInterlacingState(&vout->obj, &sys->interlacing, picture_interlaced);
}
return NULL;
}
......@@ -1826,11 +1841,16 @@ static void vout_ReleaseDisplay(vout_thread_sys_t *vout)
filter_DeleteBlend(sys->spu_blend);
/* Destroy the rendering display */
if (sys->private.private_pool != NULL)
if (sys->private_pool != NULL)
{
vout_FlushUnlocked(vout, true, VLC_TICK_MAX);
picture_pool_Release(sys->private_pool);
sys->private_pool = NULL;
}
vlc_queuedmutex_lock(&sys->display_lock);
vout_CloseWrapper(&vout->obj, &sys->private, sys->display);
vout_CloseWrapper(&vout->obj, sys->display);
sys->display = NULL;
vlc_queuedmutex_unlock(&sys->display_lock);
......@@ -1857,7 +1877,7 @@ static void vout_ReleaseDisplay(vout_thread_sys_t *vout)
picture_fifo_Delete(sys->decoder_fifo);
sys->decoder_fifo = NULL;
}
assert(sys->private.private_pool == NULL);
assert(sys->private_pool == NULL);
vlc_mutex_lock(&sys->window_lock);
vout_display_window_SetMouseHandler(sys->display_cfg.window, NULL, NULL);
......@@ -2036,7 +2056,9 @@ vout_thread_t *vout_Create(vlc_object_t *object)
sys->title.timeout = var_InheritInteger(vout, "video-title-timeout");
sys->title.position = var_InheritInteger(vout, "video-title-position");
vout_InitInterlacingSupport(vout, &sys->private);
sys->private_pool = NULL;
vout_InitInterlacingSupport(vout, &sys->interlacing);
sys->is_late_dropped = var_InheritBool(vout, "drop-late-frames");
......@@ -2183,7 +2205,7 @@ int vout_Request(const vout_configuration_t *cfg, vlc_video_context *vctx, input
if (sys->display != NULL)
vout_StopDisplay(cfg->vout);
vout_ReinitInterlacingSupport(cfg->vout, &sys->private);
vout_ReinitInterlacingSupport(cfg->vout, &sys->interlacing);
sys->delay = 0;
sys->rate = 1.f;
......
......@@ -28,27 +28,23 @@
#include <vlc_picture_pool.h>
#include <vlc_vout_display.h>
typedef struct vout_thread_private_t vout_thread_private_t;
typedef struct vout_interlacing_state_t vout_interlacing_state_t;
/* */
struct vout_thread_private_t
struct vout_interlacing_state_t
{
struct {
bool is_interlaced;
bool has_deint;
vlc_tick_t date;
} interlacing;
picture_pool_t *private_pool;
bool is_interlaced;
bool has_deint;
vlc_tick_t date;
};
/* */
vout_display_t *vout_OpenWrapper(vout_thread_t *, vout_thread_private_t *, const char *,
vout_display_t *vout_OpenWrapper(vout_thread_t *, const char *,
const vout_display_cfg_t *, const video_format_t *, vlc_video_context *);
void vout_CloseWrapper(vout_thread_t *, vout_thread_private_t *, vout_display_t *vd);
void vout_CloseWrapper(vout_thread_t *, vout_display_t *vd);
void vout_InitInterlacingSupport(vout_thread_t *, vout_thread_private_t *);
void vout_ReinitInterlacingSupport(vout_thread_t *, vout_thread_private_t *);
void vout_SetInterlacingState(vout_thread_t *, vout_thread_private_t *, bool is_interlaced);
void vout_InitInterlacingSupport(vout_thread_t *, vout_interlacing_state_t *);
void vout_ReinitInterlacingSupport(vout_thread_t *, vout_interlacing_state_t *);
void vout_SetInterlacingState(vout_thread_t *, vout_interlacing_state_t *, bool is_interlaced);
#endif // LIBVLC_VOUT_PRIVATE_H
......@@ -49,21 +49,10 @@ static void VoutViewpointMoved(void *sys, const vlc_viewpoint_t *vp)
var_SetAddress(vout, "viewpoint-moved", (void*)vp);
}
/* Minimum number of display picture */
#define DISPLAY_PICTURE_COUNT (1)
/* It should be high enough to absorb jitter due to difficult picture(s)
* to decode but not too high as memory is not that cheap.
*
* It can be made lower at compilation time if needed, but performance
* may be degraded.
*/
#define VOUT_MAX_PICTURES (20)
/*****************************************************************************
*
*****************************************************************************/
vout_display_t *vout_OpenWrapper(vout_thread_t *vout, vout_thread_private_t *sys,
vout_display_t *vout_OpenWrapper(vout_thread_t *vout,
const char *splitter_name, const vout_display_cfg_t *cfg,
const video_format_t *fmt, vlc_video_context *vctx)
{
......@@ -89,29 +78,6 @@ vout_display_t *vout_OpenWrapper(vout_thread_t *vout, vout_thread_private_t *sys
if (vd == NULL)
return NULL;
const unsigned private_picture = 4; /* XXX 3 for filter, 1 for SPU */
const unsigned kept_picture = 1; /* last displayed picture */
const unsigned reserved_picture = DISPLAY_PICTURE_COUNT +
private_picture +
kept_picture;
picture_pool_t *display_pool = vout_GetPool(vd, reserved_picture);
if (display_pool == NULL)
goto error;
if (!vout_IsDisplayFiltered(vd)) {
sys->private_pool = picture_pool_Reserve(display_pool, private_picture);
} else {
sys->private_pool =
picture_pool_NewFromFormat(vd->source,
__MAX(VOUT_MAX_PICTURES,
private_picture + kept_picture));
}
if (sys->private_pool == NULL) {
picture_pool_Release(display_pool);
goto error;
}
#ifdef _WIN32
var_Create(vout, "video-wallpaper", VLC_VAR_BOOL|VLC_VAR_DOINHERIT);
var_AddCallback(vout, "video-wallpaper", Forward, vd);
......@@ -119,22 +85,13 @@ vout_display_t *vout_OpenWrapper(vout_thread_t *vout, vout_thread_private_t *sys
var_SetBool(VLC_OBJECT(vout), "viewpoint-changeable",
vd->fmt->projection_mode != PROJECTION_MODE_RECTANGULAR);
return vd;
error:
vout_display_Delete(vd);
return NULL;
}
/*****************************************************************************
*
*****************************************************************************/
void vout_CloseWrapper(vout_thread_t *vout, vout_thread_private_t *sys, vout_display_t *vd)
void vout_CloseWrapper(vout_thread_t *vout, vout_display_t *vd)
{
assert(sys->private_pool);
picture_pool_Release(sys->private_pool);
sys->private_pool = NULL;
#ifdef _WIN32
var_DelCallback(vout, "video-wallpaper", Forward, vd);
#else
......
......@@ -28,9 +28,6 @@
/* XXX DO NOT use it outside the vout module wrapper XXX */
struct vout_crop;
picture_pool_t *vout_GetPool(vout_display_t *vd, unsigned count);
bool vout_IsDisplayFiltered(vout_display_t *);
picture_t * vout_ConvertForDisplay(vout_display_t *, picture_t *);
void vout_FilterFlush(vout_display_t *);
......