forked from molayab/Cliente-VideoSocket--iOS-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJPGStream.h
More file actions
52 lines (46 loc) · 1.28 KB
/
JPGStream.h
File metadata and controls
52 lines (46 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//
// JPGStream.h
// UDP - Socket
//
// Created by Mateo Olaya Bernal on 24/03/13.
// Copyright (c) 2013 Mateo Olaya Bernal. All rights reserved.
//
#define MAX_QUEUE_FRAMES 10000
#import <Foundation/Foundation.h>
typedef enum JPGFpsTypes
{
JPGFps1 = 1,
JPGFps2 = 2,
JPGFps3 = 3,
JPGFps4 = 4,
JPGFps5 = 5,
JPGFps10 = 10,
JPGFps15 = 15,
JPGFps20 = 20,
JPGFps24 = 24
} JPGFps; // Segundos por Frame
@class JPGStream;
@protocol JPGStreamDelegate <NSObject>
@optional
- (void)JPGStream:(JPGStream *)stream didShowFrame:(UIImage *)frame;
- (void)JPGStream:(JPGStream *)stream didEndOfBuffer:(BOOL)isWaiting;
- (void)JPGStream:(JPGStream *)stream didErrorWhenExecute:(NSError *)error;
- (void)JPGStream:(JPGStream *)stream didStopStreamDataFlow:(UIImage *)lastFrame;
- (void)JPGStream:(JPGStream *)stream didAppedData:(UIImage *)image;
@end
@interface JPGStream : NSObject
{
long bytes,
framesIndex;
NSTimer *caller;
}
@property (nonatomic, assign) id<JPGStreamDelegate> delegate;
@property (nonatomic, strong, readonly) NSMutableArray *frames;
@property (nonatomic) JPGFps fps;
@property (nonatomic) NSUInteger waitForBuffer; // En segundos
- (id)init;
- (id)initWhitDelegate:(id)delegate spf:(JPGFps)fps;
- (void)playStream;
- (void)stopStream;
- (void)appendFrame:(UIImage *)frame;
@end