-
Notifications
You must be signed in to change notification settings - Fork 9.7k
[camera] Fixed a crash when streaming on iOS #4520
Changes from 1 commit
29beaa7
aec0f93
0d9f61a
7cff775
5d1fb56
7c0fa9e
3056e17
1a48ffc
4cb5d6e
27957a1
97d16c7
1382d62
46d9df0
84dc53d
3ed1e94
9a3e627
6191e3a
e732d7b
b69ea0f
e9beb1f
74d9d85
6b81e1a
96f8edb
1167112
24871c6
7635469
376bbfa
f276bd0
f69aed6
9653345
661cf49
8e334bf
7b8d74f
ab233fa
830d5ad
095faf3
e185988
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -60,6 +60,10 @@ NS_ASSUME_NONNULL_BEGIN | |
| - (void)setExposureModeWithResult:(FLTThreadSafeFlutterResult *)result mode:(NSString *)modeStr; | ||
| - (void)setFocusModeWithResult:(FLTThreadSafeFlutterResult *)result mode:(NSString *)modeStr; | ||
| - (void)applyFocusMode; | ||
|
|
||
| /// Sets that a streaming image has been received. | ||
| /// Call it every time a streaming image is received. | ||
| /// To prevent memory consumption, the number of frames pending processing is limited. | ||
| - (void)receivedImageStreamData; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This needs a declaration comment, per style guide. (I know almost nothing else in this header current has one, but existing style violations aren't a reason to perpetuate new style violations.)
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. |
||
|
|
||
| /** | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,11 +6,14 @@ | |
| #import "FLTSavePhotoDelegate.h" | ||
|
|
||
| @interface FLTImageStreamHandler : NSObject <FlutterStreamHandler> | ||
| // The queue on which `eventSink` property should be accessed | ||
|
|
||
| /// The queue on which `eventSink` property should be accessed | ||
|
||
| @property(nonatomic, strong) dispatch_queue_t captureSessionQueue; | ||
| // `eventSink` property should be accessed on `captureSessionQueue`. | ||
| // The block itself should be invoked on the main queue. | ||
|
|
||
| /// `eventSink` property should be accessed on `captureSessionQueue`. | ||
| /// The block itself should be invoked on the main queue. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A declaration comment should start wit a description of what something is, before getting into how to use it. So: |
||
| @property FlutterEventSink eventSink; | ||
|
|
||
| @end | ||
|
|
||
| // APIs exposed for unit testing. | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Sets" implies that there's a boolean toggle here, which isn't the case. And the last sentence of this comment isn't relevant to clients using the method.
I wold replace this whole declaration comment with something like:
(This file uses /** ... */ style. Ideally we'd be consistent within the whole project, but we should at least have file-level consistency.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I learned a lot. Thank you.
I ended up using your suggestion in its entirety.