How to access frames of RTCVideoRenderer ? (ios) - c++

I try to access frames of RTCVideoRenderer without success, can you help me please ?
I noticed that there is a "didCaptureVideoFrame" method in RTCVideoCapturerDelegate, but not in RTCVideoViewDelegate.
I have never done objc, I added a method in RTCVideoViewDelegate to get frames (bellow "didChangeVideoSize"), but it do not get fired, I guess it do not work like that.
I am able to access frames from the remote using Android using the "onFrame" of VideoSink, I thought it would be that easy using ios.
PS: To add the method, I took the framework from the pod and put it in the project, because I noticed that when you modify a pod, changes do not apply.
Here is the line I added :
- (void)videoView:(id<RTCVideoRenderer>)videoView didRenderVideoFrame:(RTCVideoFrame *)frame;
I will now try to compile the library with the changes I want.
EDIT:
I am now compiling the library, I noticed the need to change several files to be able to access frames, it will not be done just by adding 10 lines.

Solved thanks to this : How to get frame data in AppRTC iOS app for video modifications?
I used this line instead (because names changed since) :
#property(atomic, strong) RTCVideoFrame* videoFrame;
I wanted a "onFrame" like VideoSink on Android, but it will be ok for now.

Related

Building 'multi interface' using wxWidget

I have read several demos given by the wxWidget package, but none of them is 'multi interface'. Say I want to write a simple game using wxWidget, I may need a menu interface, a game interface, a setting interface and so on. My question is how can I build them into a single App? Do I need several wxFrame and Close and Show them from time to time? (However when I close it the application is terminated) Or is there an another way?
You can indeed have multiple frames, but by default closing the last frame terminates the application. You can use SetExitOnFrameDelete(false) to prevent this from happening or just make sure that you create the new/next frame (without necessarily showing it) before closing the previous one.
It is also possible to simply show different contents inside the same frame, e.g. by creating and showing different wxPanels inside it. wxSimplebook can be useful for this.

Property cupertinoCalculateChunkIDBasedOnTimecode in Wowza

I am using Wowza Engine 4.5.0 and I am trying to change the chunk ID numbering based on incoming packet time, instead of the default sequential number that cause problems when restarting the encoder.
From something like this
...media_w112312312_b1024000_7.ts
...media_w112312312_b1024000_8.ts
to a timestamp notation where the chunks continue even after a restart
I read about the property cupertinoCalculateChunkIDBasedOnTimecode, I follow the instructions in this guide to configure it:
https://www.wowza.com/docs/how-to-configure-apple-hls-packetization-cupertinostreaming#livepropref
but it does not work or I am doing something wrong. Has anyone used the property
cupertinoCalculateChunkIDBasedOnTimecode successfully?
many thanks
I have used 'cupertinoCalculateChunkIDBasedOnTimecode' property and even if I restart my encoder, players are able to pick up the stream and play successfully.
The below page will help you in using it properly
http://thewowza.guru/how-to-set-stream-timecodes-to-absolute-time/

C++ - Coding video game sound effects?

I've done a bunch of research, but I can't figure out how to load a .wav file into memory and then play it. Also, I'd like to have the capability to simultaneously play multiple loaded .wav files.
Currently, I load the .wav file into string buffer, then call:
PlaySound(stows(buffer).c_str(), NULL, SND_MEMORY);
stows() is a function I created which converts a string into a wide string.
What am I doing wrong/what could I be doing better?
EDIT: I'm trying to use SFML now. I followed the walkthrough here to a T, but I'm getting 9 linker errors when I attempt to compile. It doesn't matter if I use the static or dynamic dlls.
EDIT2: I must have VS2010 32 bit. I downloaded SFML 2.0 32 bit for VS2010 and now I'm down to 5 linker errors. It says all of them are occurring in sfml-audio-s.lib.
EDIT3: I got it to compile! However, it simply isn't playing anything. I used VS to debug and confirmed that I am opening the WAV file correctly and storing it in a Sound object, but when I call the play() method, nothing happens. Furthermore, I'm getting an unhandled exception every time I close the program.
I'm reasonably convinced that PlaySound isn't able of mixing two sounds playing simultaneously. You can have one sound interrupt the other, and you can make it play "in the background" while your code is doing other things (using SND_ASYNC), but the documentation is pretty clearly stating that "if another sound is played, the current one stops" - in the section of SND_NOSTOP:
If this flag is not specified, PlaySound attempts to stop any sound
that is currently playing in the same process
(If you specify SND_NOSTOP, it doesn't play this sound if another one is already playing).
Link to full documentation: PlaySound.
I'm afraid I don't know exactly how you create sound playing using multiple sounds simultaneously, as I've never done that on a PC (I have used hardware mixers, and I've also written code to merge two sounds from a file, but that's almost certainly not what you want)
I got it working! I ended up using direct sound. I made a class to load and play .WAV files based on a tutorial I found here, which was immensely helpful.

codec-changes causes IMediaSeeking to fail setPosition

I was happily improving my C++-program where I read videos via directshow. Now I tried to also write videos which was also nicely working.
Then came the search for an appropriate codec (thought about vob/ogg)...
However, suddenly today the video was displayed really slowly.
And now that I uninstalled any additional codecs I installed before, the video won't play at all.
The reason seems to be CComQIPtr< IMediaSeeking, &IID_IMediaSeeking > pSeeking( pGraph ); and hr = pSeeking->SetPositions( &Startzeit, AM_SEEKING_AbsolutePositioning,NULL, AM_SEEKING_NoPositioning ); gives an error, SetPosition is not supported at that time... acutally at any time.
also hr=pSeeking->GetDuration(&duration) returns 0 and the corresponding AM_MEDIA_TYPE mt; I use to get the framepersecond has an empty format-type. (pbFormat is Null).
Did I unintentionally installed/uninstalled something important?
Have you heard of similar problems?
As I said, some days ago the same video and source-code was working fine (I commented by changes out by now).
I would like to give you more source-code but it is kind of long but if you think it would be helpful I will add it of course.
Regards,
Julian
Here is the source-code: http://pastebin.com/jMdWejH9
It's of course only a part of the whole code, but I think this is the main part as here are all filters inserted.
Keep in mind that this actually worked until some days before!^^
The first part is the variable-deklaration (all important variables as fas as I could tell, the second is the function called)
If you render a file in DirectShow, the framework uses the installed codecs/filters in the system. If you remove some codecs it takes another or breaks because it can't render. To know wich filters the framework uses you can try to render the file in GraphEdit or GraphStudioNext. (Just drop the file on one of these programms and see the filtergraph). We got the best results with the codec pack ffdshow-tryouts and the Haali Media Splitter for our player.

How do I check if a swf file loaded correctly since put_Movie always returns S_OK?

I am using the latest flash player and have a swf file served locally from my dev machine. In one container test app I am able to play the swf and make calls to it, but in my "Real" application the same code path results in com errors (basically it looks like the swf isn;' loading properly)
Additionally this is made more challenging because no matter what nonsense I put in the call to put_Movie() the return is ALWAYS S_OK. This is confusing.
How am I supposed to determine if the swf file loaded and is working?
As a follow-on, what would cause a swf file (the same one) not to load in a different app? The code paths are the same (from what I can tell).
Obviousl something is going on, but I am not sure what.
So, I guess 2 questions
How to know when swf file doesn't load right
Why might it fail in a different container application?
I am using ATL in Visual studio 2008, latest flash, MS Vista
Thanks
Hmm, it seems that if I listen for the DISPID_READYSTATECHANGE events then that helps me.
A value of '4' seems to indicate it is ready to accept method calls.