Open ispysoftware opened 5 years ago
It sounds like it's time for a how-to on exposing APIs in the Dll. This is a @robin-raymond question, but we can walk you through it.
Yeah any pointers would be greatly appreciated - we've hit a bit of a wall here
@SergioOpenPeer As part of the python scripting can you ensure the regeneration is documented properly and I'll work on documenting more how the IDL works (including the binding process).
@ispysoftware If you want to regenerate files generated from idl, you have to delete .flg files from this folder webrtc-uwp-sdk\webrtc\xplatform\webrtc\third_party\idl\zsLib-eventing , and to be sure that everything is regenerate properly you can delete generated files that are in this folder webrtc-uwp-sdk\webrtc\xplatform\webrtc\sdk\windows\wrapper\generated
In couple of days, new scripts for environment preparation and building will be published, and there will be option for cleaning idl generated files and their flags.
@SergioOpenPeer Thanks for that. What do i have to run to regenerate the files i just deleted? Tried running prepare.bat again but it didn't regenerate anything
@ispysoftware Just run build. It will be regenerated during build process
Oh OK - so it regenerated the bindings for webrtc but not for the code that i've added into the WrapperGlue project. I've added a class and a header in to do custom video capture which is building but I can't access it via the org.webrtc library. What do I need to do to be able to call this code?
@SergioOpenPeer Can you give a "hack" they can use right now to force regeneration? I know deleting *.flg files and deleting webrtc/out will do it but there might be a more optimal way.
Maybe we're doing something wrong here.. We just want to add a new way of sending frames to webrtc so what we've done is create a new .cpp and .h file in the wrapperglue project to do that, under namespace webrtc and now we just need to be able to call that via the org.webrtc dll - is that going to work or do we have the approach all wrong? What is it we need to do to get this working?
Thanks for your responses by the way, it's much appreciated.
@ispysoftware You do need to make the IDL regenerate to make it work. IDL does not regenerate all the time and there's an ".flg" file that prevents the regeneration (intentionally) but there's also something inside webrtc ninja that prevents the regeneration as well (not sure where that part is located).
Maybe I'm missing something, but have you added the new APIs to the IDL before regenerating?
No - we haven't worked with this stuff before. Hence the request for docs/ instructions. Do you have a link to a how-to or anything? We've added basically another version of the videocapturer.cpp file into the wrapperglue project and just need to know what we need to do next - I can't see an existing videocapturer .idl file anywhere yet it seems to be generated anyway. Pretty confused..
Maybe this would just be easier as a feature request - as I feel like this rabbit hole is going to go pretty deep. We need to be able to setup custom audio and video sources - so not using devices, just push audio and video frames into the renderer as byte pointers - like:
void VideoCapturer::PushFrame(uint8_t* videoFrame, int videoFrameLength) {
int stride_y = width_;
int stride_uv = (width_ + 1) / 2;
int target_width = width_;
int target_height = height_;
rtc::scoped_refptr<I420Buffer> buffer = I420Buffer::Create(target_width, abs(target_height), stride_y, stride_uv, stride_uv);
libyuv::RotationMode rotation_mode = libyuv::kRotate0;
const int conversionResult = libyuv::ConvertToI420(
videoFrame, videoFrameLength, buffer.get()->MutableDataY(),
buffer.get()->StrideY(), buffer.get()->MutableDataU(),
buffer.get()->StrideU(), buffer.get()->MutableDataV(),
buffer.get()->StrideV(), 0, 0, // No Cropping
width_, height_, target_width, target_height, rotation_mode,
FOURCC_24BG);
if (conversionResult < 0) {
RTC_LOG(LS_ERROR) << "Failed to convert capture frame from type "
<< static_cast<int>(FOURCC_24BG) << " to I420.";
return;
}
int64_t captureTime = 0;
VideoFrame captureFrame(buffer, 0, rtc::TimeMillis(), kVideoRotation_0);
captureFrame.set_ntp_time_ms(captureTime);
OnFrame(captureFrame, captureFrame.width(), captureFrame.height());
}
We need this internally as well. Could you email the request and I'll add the team working on it to discuss? But yes it's a good amount of work. Here's more info on IDL: https://github.com/webrtc-uwp/webrtc-uwp-sdk/wiki/WebRTC-UWP-and-IDL
@jamescadd sent you an email, please let me know if you get it
@ispysoftware email received/replied. Keeping this open until the documentation is added to the above and we can go from there.
I'm adding code to the WrapperGlue project and want to expose it via the Org.WebRtc dll but i'm struggling to figure out how to do this. All the files under the wrapper directory have
//Generated by zsLibEventingTool
.. at the top but I can't find any instructions on how to run this to generate the files in the wrapper - rebuilding the project (which is what it says to do in the readme.txt file) isn't generating new wrapper code. Are there any docs for this? The docs in the solution folder are just empty templates.