fixed a bunch of stuff:
- pairing now exists - hostnames are resolved - video rendering is better - some other stuff I’m forgetting
This commit is contained in:
1 parent
ef6909da88
commit
45b9f5411e
13 files changed
+420
-104
No files matched your search
+30
-19
@@ -21,21 +21,48 @@
|
||||
|
||||
void setup(int width, int height, int fps, void* context, int drFlags)
|
||||
{
|
||||
nv_avc_init(width, height, 0, 2);
|
||||
printf("Setup video\n");
|
||||
nv_avc_init(width, height, DISABLE_LOOP_FILTER | FAST_DECODE | FAST_BILINEAR_FILTERING, 2);
|
||||
}
|
||||
|
||||
void submitDecodeUnit(PDECODE_UNIT decodeUnit)
|
||||
{
|
||||
unsigned char* data = (unsigned char*) malloc(decodeUnit->fullLength + nv_avc_get_input_padding_size());
|
||||
if (data != NULL) {
|
||||
int offset = 0;
|
||||
int err;
|
||||
|
||||
PLENTRY entry = decodeUnit->bufferList;
|
||||
while (entry != NULL) {
|
||||
memcpy(&data[offset], entry->data, entry->length);
|
||||
offset += entry->length;
|
||||
entry = entry->next;
|
||||
}
|
||||
|
||||
err = nv_avc_decode(data, decodeUnit->fullLength);
|
||||
if (err != 0) {
|
||||
printf("Decode failed: %d\n", err);
|
||||
}
|
||||
|
||||
free(data);
|
||||
}
|
||||
}
|
||||
|
||||
void start(void)
|
||||
{
|
||||
printf("Start video\n");
|
||||
[VideoRenderer startRendering];
|
||||
}
|
||||
|
||||
void stop(void)
|
||||
{
|
||||
printf("Stop video\n");
|
||||
[VideoRenderer stopRendering];
|
||||
}
|
||||
|
||||
void release(void)
|
||||
{
|
||||
printf("Release video\n");
|
||||
nv_avc_destroy();
|
||||
}
|
||||
|
||||
@@ -52,30 +79,14 @@ void release(void)
|
||||
callbacks.start = start;
|
||||
callbacks.stop = stop;
|
||||
callbacks.release = release;
|
||||
//callbacks.submitDecodeUnit = submitDecodeUnit;
|
||||
callbacks.submitDecodeUnit = submitDecodeUnit;
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
-(void) main
|
||||
{
|
||||
int err;
|
||||
|
||||
NSLog(@"Starting connection process\n");
|
||||
|
||||
err = performHandshake(host);
|
||||
NSLog(@"Handshake: %d\n", err);
|
||||
|
||||
err = initializeControlStream(host, &streamConfig);
|
||||
NSLog(@"Control stream init: %d\n", err);
|
||||
|
||||
initializeVideoStream(host, &streamConfig, &callbacks);
|
||||
|
||||
err = startControlStream();
|
||||
NSLog(@"Control stream start: %d\n", err);
|
||||
|
||||
err = startVideoStream(NULL, 0);
|
||||
NSLog(@"Video stream start: %d\n", err);
|
||||
LiStartConnection(host, &streamConfig, &callbacks, NULL, 0);
|
||||
}
|
||||
|
||||
@end
|
||||
Reference in new issue
Block a user