tags:

views:

927

answers:

1

Hi,

I want to use libmms in an objective-c project. I've taken the project from here - http://www.tunein-radio.com/lgpl.html - and included the libmms library in my own project. This avoids me having to compile libmms myself. Initially I just want to see if it works and hopefully output some audio.

Here's what I have so far in my header file:

#import <UIKit/UIKit.h>
#import "mmsio.h"
#import "mms.h"



#define streamURL @"path/to/stream"

@interface radiotestAppDelegate : NSObject <UIApplicationDelegate> {
    UIWindow *window;
 struct mms_t_io *io;

}

@property (nonatomic, retain) IBOutlet UIWindow *window;


@end

I'm not really sure where to go from here but think I need to use this method from mms.h:

mms_t* mms_connect (mms_io_t *io, void *data, const char *url, int bandwidth);

However, I'm not well versed enough in C to unravel the libmms code. Can anyone offer any advice? I'd be happy to pay for some tuition but want to understand this myself.

What frameworks should I be using to read the mms_t response type from the above method?

Thanks,

+3  A: 

Hi, I never used libmms but when looking into the source code the interface seems to be very simple:

  1. You connect with mms_connect and receive a connection instance.
  2. You read from the stream using the opened connection using mms_read.
  3. You close the connection using mms_close.

For advanced functionality you have the other mms_* funtions. The IO (mms_io_t) can be null. In this case a default implementation will be used for I/O.

BTW I wonder how you would program in Objective-C without being versed enough to understand C code (the libmms code seems straight forward and easy to understand).

Update:

I cannot see where the libmms does any video decoding. There are some methods for seeking and getting header/packet information. I don't have any knowledge about video decoding - so I cannot say if you have to decode the stream data prior to playing it or if the iPhone can handle it directly.

Tilo Prütz
Thanks for your reply. Coding in Objective-C using existing apple frameworks and the wealth of tutorials / documentation available is a very different proposition to coding using C libraries. Simple for you != simple for everybody. I don't need video decoding - just audio. I think iPhone apps like TuneIn radio use FFMPEG to decode anything which isn't natively handled.
codecowboy
Nevertheless - when programming Objective-C - you are actually writing C with OO enhancements. Maybe you don't need to dig into pointers (although every object reference like `UIWindow *` is one) nor into structs and unions. However the libmms-library is definitly not complicated or even complex C code.
Tilo Prütz