[FFmpeg-devel] Realmedia patch
Ronald S. Bultje
rsbultje
Tue Sep 2 14:48:08 CEST 2008
Hi,
On Sun, Aug 31, 2008 at 7:19 PM, Michael Niedermayer <michaelni at gmx.at> wrote:
> On Sun, Aug 31, 2008 at 11:43:59AM -0400, Ronald S. Bultje wrote:
>> Hi,
>>
>> On Sat, Aug 30, 2008 at 6:05 PM, Ronald S. Bultje <rsbultje at gmail.com> wrote:
>> > The next few patches would then implement stream selection:
>> > - ASM rulebook parsing
>>
>> This patch attempts to do very simplistic (as Michael requested) ASM
>> rulebook parsing, it simply uses strcmp()s for the condition (first
>> item in each rule). I save the condition in case at some point we want
>> to allow stream changing ('a' key in ffplay), and I want to keep the
>> statements around to be able to parse them and extract things like
>> bitrate information for the AVStream-per-rule (this is not in the RM
>> header).
>
> [...]
>> @@ -85,8 +97,24 @@
>> ff_rdt_subscribe_rule (void *d, char *cmd, int size,
>> int stream_nr, int rule_nr)
>> {
>> - av_strlcatf(cmd, size, "stream=%d;rule=%d,stream=%d;rule=%d",
>> - stream_nr, rule_nr, stream_nr, rule_nr + 1);
>> + rdt_data *rdt = d;
>> + int i, first = 1;
>> +
>> + assert(rule_nr >= 0 && rule_nr < rdt->n_rules);
>> + for (i = 0; i < rdt->n_rules; i++) {
>> + if (i == rule_nr ||
>> + !strcmp(rdt->rule[i].condition, rdt->rule[rule_nr].condition)) {
>> + if (first)
>> + first = 0;
>> + else
>> + av_strlcat(cmd, ",", size);
>> +
>> + av_strlcatf(cmd, size, "stream=%d;rule=%d", stream_nr, i);
>> +#ifdef ASM_RULEBOOK_DEBUG
>> + printf("Subscribe to stream:%d,rule:%d\n", stream_nr, i);
>> +#endif
>
> printf() ?
> also, no i do not agree to this ifdeffery
> use dprintf() or whatever
I removed them, I needed them for debugging but now that it works (and
relevant values are printed by ffplay -stats), I don't really care
anymore.
> [...]
>> @@ -269,7 +348,9 @@
>> if (av_strstart(p, "OpaqueData:buffer;", &p)) {
>> rdt->mlti_data = rdt_parse_b64buf(&rdt->mlti_data_size, p);
>> rdt_load_mdpr(rdt, stream, 0);
>> - } else if (av_strstart(p, "StartTime:integer;", &p))
> [...]
>> + else if (av_strstart(p, "StartTime:integer;", &p))
>
> cosmetic
Fixed.
New patch attached.
Ronald
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: rtsp-asmrulebook.patch
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20080902/bc63eda7/attachment.txt>
More information about the ffmpeg-devel
mailing list