Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions lib/upipe-av/upipe_av.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
* @short common functions for libav wrappers
*/

#include "upipe/udeal.h"
#include "upipe/uprobe.h"
#include "upipe/upipe.h"
#include "upipe/uref_pic.h"
Expand All @@ -25,8 +24,6 @@

#include <stdbool.h>

/** structure to protect exclusive access to avcodec_open() */
struct udeal upipe_av_deal;
/** @internal true if only avcodec was initialized */
static bool avcodec_only = false;
/** @internal probe used by upipe_av_vlog, defined in upipe_av_init() */
Expand Down Expand Up @@ -72,11 +69,6 @@ bool upipe_av_init(bool init_avcodec_only, struct uprobe *uprobe)
{
avcodec_only = init_avcodec_only;

if (unlikely(!udeal_init(&upipe_av_deal))) {
uprobe_release(uprobe);
return false;
}

if (unlikely(avcodec_only)) {
#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(58, 10, 100)
avcodec_register_all();
Expand All @@ -102,7 +94,6 @@ void upipe_av_clean(void)
{
if (likely(!avcodec_only))
avformat_network_deinit();
udeal_clean(&upipe_av_deal);
if (logprobe)
uprobe_release(logprobe);
}
Expand Down
1 change: 1 addition & 0 deletions lib/upipe-av/upipe_av_codecs.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
*/

#include <string.h>
#include "upipe/ubase.h"
#include "upipe_av_internal.h"

/** @This allows to convert from avcodec ID to flow definition codec.
Expand Down
60 changes: 0 additions & 60 deletions lib/upipe-av/upipe_av_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
/** @hidden */
#define _UPIPE_AV_INTERNAL_H_

#include "upipe/udeal.h"
#include "upipe/upump.h"

#include <stdbool.h>

#include <libavutil/error.h>
Expand All @@ -38,63 +35,6 @@ enum CodecID;
#define AV_CODEC_ID_FIRST_AUDIO CODEC_ID_FIRST_AUDIO
#endif

/** structure to protect exclusive access to avcodec_open() */
extern struct udeal upipe_av_deal;

/** @This allocates a watcher triggering when exclusive access to avcodec_open()
* is granted.
*
* @param upump_mgr management structure for this event loop
* @param cb function to call when the watcher triggers
* @param opaque pointer to the module's internal structure
* @param refcount pointer to urefcount structure to increment during callback,
* or NULL
* @return pointer to allocated watcher, or NULL in case of failure
*/
static inline struct upump *upipe_av_deal_upump_alloc(
struct upump_mgr *upump_mgr, upump_cb cb, void *opaque,
struct urefcount *refcount)
{
return udeal_upump_alloc(&upipe_av_deal, upump_mgr, cb, opaque, refcount);
}

/** @This starts the watcher on exclusive access to avcodec_open().
*
* @param upump watcher allocated by @ref udeal_upump_alloc
*/
static inline void upipe_av_deal_start(struct upump *upump)
{
udeal_start(&upipe_av_deal, upump);
}

/** @This tries to grab the exclusive access to avcodec_open().
*/
static inline bool upipe_av_deal_grab(void)
{
return udeal_grab(&upipe_av_deal);
}

/** @This yields exclusive access to avcodec_open() previously acquired from
* @ref upipe_av_deal_grab.
*
* @param upump watcher allocated by @ref udeal_upump_alloc
*/
static inline void upipe_av_deal_yield(struct upump *upump)
{
udeal_yield(&upipe_av_deal, upump);
}

/** @This aborts the watcher before it has had a chance to run. It must only
* be called in case of abort, otherwise @ref upipe_av_deal_yield does the
* same job.
*
* @param upump watcher allocated by @ref udeal_upump_alloc
*/
static inline void upipe_av_deal_abort(struct upump *upump)
{
udeal_abort(&upipe_av_deal, upump);
}

/** @This allows to convert from avcodec ID to flow definition codec.
*
* @param id avcodec ID
Expand Down
Loading
Loading