MLT  7.24.0
Data Structures | Macros | Typedefs | Functions
mlt_cache.c File Reference

least recently used cache More...

#include "mlt_cache.h"
#include "mlt_frame.h"
#include "mlt_log.h"
#include "mlt_properties.h"
#include "mlt_types.h"
#include <pthread.h>
#include <stdlib.h>

Data Structures

struct  mlt_cache_item_s
 Cache item class. More...
 
struct  mlt_cache_s
 Cache class. More...
 

Macros

#define DEFAULT_CACHE_SIZE   (4)
 the default number of data objects to cache per line More...
 
#define MAX_CACHE_SIZE   (200)
 the maximum number of data objects to cache per line More...
 

Typedefs

typedef struct mlt_cache_item_s mlt_cache_item_s
 Cache item class. More...
 

Functions

static void cache_put_frame (mlt_cache cache, mlt_frame frame, int audio, int image)
 

Detailed Description

least recently used cache

See also
mlt_profile_s

Copyright (C) 2007-2023 Meltytech, LLC

This library 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.

This library 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 this library; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

Macro Definition Documentation

◆ DEFAULT_CACHE_SIZE

#define DEFAULT_CACHE_SIZE   (4)

the default number of data objects to cache per line

◆ MAX_CACHE_SIZE

#define MAX_CACHE_SIZE   (200)

the maximum number of data objects to cache per line

Typedef Documentation

◆ mlt_cache_item_s

Cache item class.

A cache item is a structure holding information about a data object including a reference count that is used to control its lifetime. When you get a a cache item from the cache, you hold a reference that prevents the data from being released when the cache is full and something new is added. When you close the cache item, the reference count is decremented. The data object is destroyed when all cache items are closed and the cache releases its reference.

Function Documentation

◆ cache_put_frame()

static void cache_put_frame ( mlt_cache  cache,
mlt_frame  frame,
int  audio,
int  image 
)
static