MM Framework "Stopping the clock"

Hi,


I’m developing a audio decoder plugin for the MM DDK and I’m a bit stuck :frowning:

How can I change the “Position” in a media player using a default clock
for it’s graph from my decoder plugin?
(I ofcaurse set and use the resources “Position” and “Duration” in my
player, however the time in mediaplayers won’t change :frowning:

Ideas on how to do this?

Thanks in advance

/Johan

Johan Björk wrote:

Hi,


I’m developing a audio decoder plugin for the MM DDK and I’m a bit stuck > :frowning:

How can I change the “Position” in a media player using a default clock
for it’s graph from my decoder plugin?
(I ofcaurse set and use the resources “Position” and “Duration” in my
player, however the time in mediaplayers won’t change > :frowning:

Ideas on how to do this?

Thanks in advance

/Johan


Hi Johan,

In the player code:
to get the graph “Position” or “Duration” resources a call to the macro
MmGetResourceINT64(const void *element,
const char *resource,
int64_t value)
can be made.

if you pass a MmGraph_t* as the first argument of the macro,
the mmedia library will check the graph filters for a first match,
starting from the last filter in the chain and moving backward.
example:
int64_t position;
MmGetResourceINT64(player.graph, “Position”, position);
the position value will be extracted from the audio_writer.so filter.

if you pass a MmFilter_t * as the first argument of the macro
the mmedia library will check only that filter for the resource.
example:
int64_t position;
MmGetResourceINT64(player.audiodecoderfilter, “Position”, position);
the position value will be extracted from the “audiodecoderfilter”.

Angelo.

Hi,

Thanks for the reply, however I’m still not able to get it working.

currently i’m doing like this:
In my Output_Nextbuffer callback function, I update my filters
resourcevalues, as well as doing the call:

MmSetResourceValue(channel->filter->graph,“Position”,&user->position);

Following what you wrote below, this should traverse the graph from the
back and set the value at the first plugin which has this resource.

In my mediaplayer i’m doing a call like this:
MmGetResourceINT64(graph, “Position”, current_time );

However the time in the mediaplayer crunches on with ‘real’ time instead
of what I set in my filter…

What am I doing wrong?

Thanks in advance
/Johan

Hi Johan,

Johan Björk wrote:

Hi,

Thanks for the reply, however I’m still not able to get it working.

currently i’m doing like this:
In my Output_Nextbuffer callback function, I update my filters
resourcevalues, as well as doing the call:

MmSetResourceValue(channel->filter->graph,“Position”,&user->position);

Following what you wrote below, this should traverse the graph from the
back and set the value at the first plugin which has this resource.

The problem with this approach is that the audio_writer.so filter

has the position resource defined “read-only”.


In my mediaplayer i’m doing a call like this:
MmGetResourceINT64(graph, “Position”, current_time );

However the time in the mediaplayer crunches on with ‘real’ time instead
of what I set in my filter…

You should target your new filter in the mediaplayer
MmGetResourceINT64() call.
ex:
MmFilter_t *newfilter; // your new filter.
MmGetResourceINT64(newfilter, “Position”, current_time );

What am I doing wrong?

Thanks in advance
/Johan

Cheers,
Angelo.