New Reggae tutorial
  • Paladin of the Pegasos
    Paladin of the Pegasos
    jcmarcos
    Posts: 1178 from 2003/3/13
    From: Pinto, Madrid ...
    Beautiful tutorial and sample code!
  • »19.07.10 - 08:25
    Profile
  • Moderator
    Kronos
    Posts: 2239 from 2003/2/24
    @Krashan

    I'm trying to open a picture with Reggae, but sofar no success ....

    I started based on playaudio:message from the SDK

    And changed/added the following:

    .
    .
    if (!(PictureOutputBase = OpenLibrary("multimedia/picture.output", 51))) return FALSE;
    .
    .
    .
    printf("1\n");

    if ((source = MediaNewObjectTags(
    MMA_StreamName, (LONG)filename,
    MMA_StreamType, (LONG)"file.stream",
    MMA_MediaType, MMT_PICTURE,
    TAG_END)))
    {printf("2\n");
    if ((player = NewObject(NULL, "picture.output", TAG_END)))
    {printf("3\n");

    if (MediaConnectTagList(source, 0, player, 0, NULL))
    {
    ULONG signals, sigmask = 1 << port->mp_SigBit;
    printf("3\n");
    .
    .
    .

    Ok it should fail horribly afterwards when it tries to play music out of an PNG, but it never gets that far ..
    Actually it nver even gets to that 2nd printf and all i get is "Reggae was unable to decode "ram:grab.png".

    Could it be that I'm missing something as I allway thought reggae would fall back to datatypes when it encounters a picture it has no decoder for ?
  • »09.08.10 - 20:12
    Profile
  • MorphOS Developer
    zukow
    Posts: 642 from 2005/2/9
    From: Poland
    from SCANdal:

    if ((MultimediaBase = OpenLibrary("multimedia/multimedia.class", 52)))
    {
    Object *picture;
    struct TagItem tags[10];
    char *ptr;
    struct MetaItem *metadata=NULL;

    tags[0].ti_Tag= MMA_StreamType;
    tags[0].ti_Data = (ULONG)"file.stream";
    tags[1].ti_Tag = MMA_StreamName;
    tags[1].ti_Data = msg->filename;
    tags[2].ti_Tag = MMA_MediaType;
    tags[2].ti_Data =MMT_PICTURE,
    tags[3].ti_Tag = TAG_END;
    tags[3].ti_Data =0;

    if ((picture = MediaNewObjectTagList(&tags)))
    {
    int i=0;
    data->img.dpi = 150;
    if ((metadata = (struct MetaItem *)MediaGetPort(picture, 0, MMA_MetaData)))
    {


    KPrintF("parsing metadate\n");

    while (metadata[i].mi_Length)
    {
    KPrintF("parsing metadate id %d\n", metadata[i].mi_Id );
    if (metadata[i].mi_Id == MMETA_VideoDpiX)
    {
    double *dpi;
    KPrintF("DPI found: %d\n", metadata[i].mi_Length);
    dpi = (double*)((metadata[i].mi_Data));
    data->img.dpi = *dpi;
    KPrintF("DPI: %d\n", data->img.dpi);
    break;
    }
    i++;

    }
    }

    data->img.height = MediaGetPort(picture, 0, MMA_Video_Height);
    data->img.width = MediaGetPort(picture, 0, MMA_Video_Width);

    //and reading
    i= DoMethod(picture, MMM_Pull, 0, ptr, data->img.bytesperline*data->img.height);
  • »09.08.10 - 22:12
    Profile Visit Website
  • MorphOS Developer
    Krashan
    Posts: 1107 from 2003/6/11
    From: Białystok...
    @Kronos

    1. Reggae has no datatype fallback. The main reason for this is that datatypes cannot do streamed processing.

    2. Reggae has no PNG decoder yet.

    3. In case of any problems with Reggae, run MediaLogger before running your code, switch log level to "verbose" and check log. It is usually very informative.
  • »10.08.10 - 06:38
    Profile Visit Website
  • Butterfly
    Butterfly
    SixK
    Posts: 72 from 2004/11/16
    Those who need examples on how to use Reggae and/or datatypes can have a look at sources heres :
    http://amiga.comscripts.com/phpBB/viewtopic.php?topic=105&forum=2&1

    SixK
  • »10.08.10 - 10:15
    Profile Visit Website
  • Order of the Butterfly
    Order of the Butterfly
    Posts: 186 from 2003/10/23
    Quote:


    SixK wrote:
    Those who need examples on how to use Reggae and/or datatypes can have a look at sources heres :
    http://amiga.comscripts.com/phpBB/viewtopic.php?topic=105&forum=2&1

    SixK

    there is no surcecode in the archive ;)
    I'm nerdy in the extreme
    And whiter than sour cream

    White&Nerdy 2006 Al Yankovic
  • »10.08.10 - 13:12
    Profile
  • Moderator
    Kronos
    Posts: 2239 from 2003/2/24
    Quote:


    Krashan wrote:
    @Kronos

    1. Reggae has no datatype fallback. The main reason for this is that datatypes cannot do streamed processing.

    2. Reggae has no PNG decoder yet.



    To quote a fellow MorphOS-Team-member (no names and no fingerprints) "datatypes actually are obsolete. You should consider using Reggae instead" :-P

    Well I guess I have to stick to the obsolete stuff then :roll:
  • »10.08.10 - 14:02
    Profile
  • Paladin of the Pegasos
    Paladin of the Pegasos
    jcmarcos
    Posts: 1178 from 2003/3/13
    From: Pinto, Madrid ...
    Quote:

    Kronos wrote:
    Quote:

    Krashan wrote:

    Reggae has no PNG decoder yet.


    Well I guess I have to stick to the obsolete stuff then


    It's a real shame Reggae still doesn't know about such widespread formats as PNG, not to mention MPEG... As you imply, it's like using a very modern vehicle to actually go backwards. Datatypes should be superseded by this clever MorphOS system component, but many months have passed, and its use is still severely limited.

    If I remember correctly, Krashan concentrates in the object framework, and he isn't actually doing codec work. That should be left to others but... Do others exist?
  • »10.08.10 - 15:24
    Profile
  • Butterfly
    Butterfly
    SixK
    Posts: 72 from 2004/11/16
    Damn ! You're right ! :(
    I thought i had released full source code with Reggae support, but it seem's I never did it ! ;(

    In my indexer, I still use Datatypes, when Reggae can't handle the file.

    SixK

    [ Edited by SixK on 2010/8/10 18:42 ]
  • »10.08.10 - 17:41
    Profile Visit Website
  • Priest of the Order of the Butterfly
    Priest of the Order of the Butterfly
    polluks
    Posts: 779 from 2007/10/23
    From: Gelsenkirchen,...
    Agree, I was already asking for a "driver development kit",
    wrapping the png.library should be no problem... right?
    Pegasos II G4: MorphOS 3.9, Zalman M220W · iMac G5 12,1 17", MorphOS 3.18
    Power Mac G3: OSX 10.3 · PowerBook 5,8: OSX 10.5, MorphOS 3.18
  • »10.08.10 - 18:05
    Profile
  • MorphOS Developer
    Krashan
    Posts: 1107 from 2003/6/11
    From: Białystok...
    After some period of uncertainity now ("now" as "for some months") I'm sure that my MorphOS activity is (and will be) pure hobby with no money involved. While you ("you" plural, as all registered users) treat MorphOS as a commercial product (which is obvious), from my point of view it is just a bedroom coding.

    Then Reggae being a pure hobbyist project, is not driven by any schedule or business plan, but mood and weather changes. I know it lacks some features, mainly decoders for some popular formats, but not only.

    While I cared much in the past that Reggae is used in new applications, now it does not matter for me that much. If one prefers datatypes, no problem.

    Said all that, I can assure you, I will keep developing Reggae in the future, adding new features and new formats. But please don't ask me "why don't you create wxyz decoder, it is just a matter of wrapping libwxyz". Sure, but doing wrappers is just plain boring. Hobby should not be boring. New classes will be properly documented and accompanying tutorials and examples will be added to MorphZone Library. It includes a kind of development kit for writing new classes at some point in the future.

    And BTW, MPEG Audio decoder/demuxer is finished. It just waits for MorphOS 2.6. It was almost ready for 2.5, but betatesters reported problems with MPEG recognition routine, there were false positive identifications. Then one of users helped me by writing a scanner identifying all files in a dir recursively and ran it over enormous number of files. Then I was able to refine the recognition code. Detecting MPEG streams is not easy as there is no specific header in them. Then release of these classes had to be delayed and they didn't make into 2.5. Current routine has been tested on over half a million of files and seem to be very robust and precise.

    [ Edited by Krashan on 2010/8/10 21:20 ]
  • »10.08.10 - 20:13
    Profile Visit Website
  • MorphOS Developer
    zukow
    Posts: 642 from 2005/2/9
    From: Poland
    Quote:


    jcmarcos wrote:
    That should be left to others but... Do others exist?


    http://brain.umcs.lublin.pl/~rzookol/classes.html ??

    png.decoder exists but required morphos1.4.5 so i have to rewrite it to 2.x
  • »10.08.10 - 20:23
    Profile Visit Website
  • Order of the Butterfly
    Order of the Butterfly
    r-tea
    Posts: 301 from 2005/3/27
    From: Poland, Zdzies...
    @ Kronos

    Are your Reagge attempts mean you're going to reissue SteamDraw? :-)
    Mac mini G4@1,5GHz silent upgrade + Xerox Phaser 3140 + EPSON Perfection 1240U
    Commodore C64C + 2 x 1541II + Datasette + SD-Box

    I miss draggable screens... and do you? I know I'm in a minority unfortunately.
  • »12.08.10 - 10:48
    Profile
  • Paladin of the Pegasos
    Paladin of the Pegasos
    jcmarcos
    Posts: 1178 from 2003/3/13
    From: Pinto, Madrid ...
    Quote:

    Krashan wrote:

    from my point of view it is just a bedroom coding.


    You are very honest to us, thankyou. I understand each and every point you mentioned. And I also believe that you know that, to most of us, Reggae is an "official" component of MorphOS.

    Quote:

    If one prefers datatypes, no problem.


    If I were you, I'd have problems accepting that. If I write a program to do someting better, and people still have to do it the old way...

    Quote:

    I will keep developing Reggae in the future


    That's great news. Your final task would be to provide tools for others to add codecs. If you do that, I understand the circle is complete. It's just that you don't draw it fully by yourself alone.

    Quote:

    doing wrappers is just plain boring. Hobby should not be boring.


    Understood 100%

    Quote:

    development kit for writing new classes at some point in the future.


    Just as needed!

    Quote:

    MPEG Audio decoder/demuxer is finished. It just waits for MorphOS 2.6.


    Oh. What does it need that MorphOS 2.5 doesn't have? Or is it that you prefer releasing it together with the operating system update?

    Quote:

    Current routine has been tested on over half a million of files


    Amazing story!
  • »12.08.10 - 13:34
    Profile
  • MorphOS Developer
    Krashan
    Posts: 1107 from 2003/6/11
    From: Białystok...
    I've added two more small articles about Reggae to MorphZone Library. Not tutorials this time, but some general info. Look here.
  • »16.08.10 - 22:32
    Profile Visit Website
  • Caterpillar
    Caterpillar
    breed
    Posts: 33 from 2004/7/6
    From: Montpellier, F...
    Good job Krashan.
    Download FroGGui and my tracks here
  • »19.08.10 - 13:37
    Profile Visit Website