I need to change the video quality of my publisher.
I face a conversion problem from Objective C to Swift 3.0.
Here is my Objective C code:
OTPublisherSettings *settings = [[OTPublisherSettings alloc] init];
settings.name = #"Bob's video";
settings.audioTrack = NO;
settings.videoTrack = YES;
settings.cameraResolution = OTCameraCaptureResolutionHigh;
settings.cameraFrameRate = OTCameraCaptureFrameRate30FPS;
and the converted Swift code is
let settings = OTPublisherSettings()
settings.name = "Bob's video"
settings.audioTrack = false
settings.videoTrack = true
settings.cameraResolution = OTCameraCaptureResolutionHigh
settings.cameraFrameRate = OTCameraCaptureFrameRate30FPS
Last two lines show error messages "Use of unresolved identifier 'OTCameraCaptureResolutionHigh'".
Please advise. It seems swift uses another set of variables for the above.
let settings = OTPublisherSettings()
settings.name = "Bob's video"
settings.audioTrack = false
settings.videoTrack = true
settings.cameraResolution = .high
settings.cameraFrameRate = .30fps
Related
Is there a way to color console.log messages in WebStorm like dev tools?
see image
Yes. You could do something like:
console.log('\x1b[36m%s\x1b[0m', 'I am cyan'); //cyan
%s is where in the string gets injected.
Colors reference
Reset = "\x1b[0m"
Bright = "\x1b[1m"
Dim = "\x1b[2m"
Underscore = "\x1b[4m"
Blink = "\x1b[5m"
Reverse = "\x1b[7m"
Hidden = "\x1b[8m"
FgBlack = "\x1b[30m"
FgRed = "\x1b[31m"
FgGreen = "\x1b[32m"
FgYellow = "\x1b[33m"
FgBlue = "\x1b[34m"
FgMagenta = "\x1b[35m"
FgCyan = "\x1b[36m"
FgWhite = "\x1b[37m"
BgBlack = "\x1b[40m"
BgRed = "\x1b[41m"
BgGreen = "\x1b[42m"
BgYellow = "\x1b[43m"
BgBlue = "\x1b[44m"
BgMagenta = "\x1b[45m"
BgCyan = "\x1b[46m"
BgWhite = "\x1b[47m"
Details: https://stackoverflow.com/a/41407246/2589276
No, it's not possible; styling console output is not supported. Please vote for WEB-12349 to be notified on any progress
worked for me like this:
var red = ['color: red'].join(';');
and to output:
console.log("%c I'm RED!",red)
EDIT: Works for me only in Chrome and Firefox
I have set dryRun to YES
#if DEBUG
[[GAI sharedInstance] setDryRun:YES];
[[[GAI sharedInstance] logger] setLogLevel:kGAILogLevelVerbose];
#endif
but still see logs like this
2014-10-03 08:58:09.933 HelloWorld[85791:677983] VERBOSE: GoogleAnalytics 3.09 -[GAIBatchingDispatcher persist:] (GAIBatchingDispatcher.m:431): Saved hit: {
parameters = {
"&_crc" = 0;
"&_u" = ".1111";
"&_v" = "mi3.0.9";
"&a" = 941551484;
"&aid" = "co.helloworld.ios";
"&an" = "HelloWorld";
"&av" = "1.0";
"&cd" = "Test Test";
"&cid" = "ca931366-1111-483b-bbcc-111111111111";
"&sr" = 320x568;
"&t" = screenview;
"&tid" = "UA-11111111-1";
"&uid" = "87492A55-98E4-4FF7-1111-111111111111";
"&ul" = en;
"&v" = 1;
"&z" = 4381801786046188211;
gaiVersion = "3.09";
};
timestamp = "2014-10-03 05:58:09 +0000";
}
Where is my fault? How can I disable GAS for debug?
You can also try to setDispatchInterval to negative or/and set optOut to true.
Hello and thanks for your time,
I am creating an application that moves video files around to be processed by other applications. In the past, I have used mediainfo, and ffmpeg, in ruby to obtain codec information about each file. I would however like to transfer all of this into one beautiful cocoa app. I have searched and searched and still can't find a solution (without using ffmpeg) on how to do this. I am basically looking for the exact same info you get in the quicktime video inspector window (apple + i).
Any help would be greatly appreciated, sample code, even more so.
Thanks.
You can use Spotlight Queries (NSMetadataQuery), like the mdls command do :
> mdls ~/Music/iTunes/iTunes\ Media/iTunes\ U/WWDC\ 2011\ Session\ Videos\ -\ HD/1-01\ Apple\ Platforms\ Kickoff.m4v
kMDItemAudioBitRate = 103
kMDItemAudioChannelCount = 2
kMDItemCodecs = (
AAC,
"H.264"
)
kMDItemContentCreationDate = 2011-07-01 15:49:56 +0000
kMDItemContentModificationDate = 2011-07-01 16:13:39 +0000
kMDItemContentType = "com.apple.m4v-video"
kMDItemContentTypeTree = (
"com.apple.m4v-video",
"public.movie",
"public.audiovisual-content",
"public.data",
"public.item",
"public.content"
)
kMDItemDateAdded = 2011-07-01 16:13:39 +0000
kMDItemDisplayName = "1-01 Apple Platforms Kickoff.m4v"
kMDItemDurationSeconds = 2787.754421087755
kMDItemFSContentChangeDate = 2011-07-01 16:13:39 +0000
kMDItemFSCreationDate = 2011-07-01 15:49:56 +0000
kMDItemFSCreatorCode = "hook"
kMDItemFSFinderFlags = 0
kMDItemFSHasCustomIcon = 0
kMDItemFSInvisible = 0
kMDItemFSIsExtensionHidden = 0
kMDItemFSIsStationery = 0
kMDItemFSLabel = 0
kMDItemFSName = "1-01 Apple Platforms Kickoff.m4v
kMDItemFSNodeCount = 1147843844
kMDItemFSOwnerGroupID = 20
kMDItemFSOwnerUserID = 502
kMDItemFSSize = 1147843844
kMDItemFSTypeCode = ""
kMDItemKind = "Video Media"
kMDItemLogicalSize = 1147843844
kMDItemMediaTypes = (
Sound,
Video
)
kMDItemPhysicalSize = 1147846656
kMDItemPixelHeight = 540
kMDItemPixelWidth = 958
kMDItemProfileName = "HD (1-1-1)"
kMDItemStreamable = 0
kMDItemTotalBitRate = 3287
kMDItemVideoBitRate = 3184
Or you can check the AVFoundation framework.
Sample code:
-(NSDictionary *) metadataForFileAtPath:(NSString *) path {
NSURL *url = [[[NSURL alloc] initFileURLWithPath:path] autorelease];
MDItemRef itemRef = MDItemCreateWithURL(NULL, (CFURLRef)url);
NSArray *attributeNames = (NSArray *)MDItemCopyAttributeNames(itemRef);
NSDictionary *attributes = (NSDictionary *) MDItemCopyAttributes(itemRef, (CFArrayRef) attributeNames);
CFRelease(itemRef);
// probably it is leaking memory (attributeNames and attributes), better check with Instruments
return attributes;
}
I'm having a hard-time debugging a local variable. I'm running gcc 4.2, XCode 3.2.4, base SDK Mac OS 10.5, and Objective-C++ in Debug-Mode.
Here's the issue. I'm working on trying to understand some code and it goes like this:
#define MAX4D 500
...
NSMutableArray *viewerPix[ MAX4D ];
When I hover over it during debug (pause on the line before and after) I get this
Unable to access variable "viewerPix"
Unable to access variable "viewerPix"
Unable to access variable "viewerPix"
...
repeated until I kill the application. What would cause this? I've tried setting it to a lower number... but to no avail. Even after I actually set the C-Array:
viewerPix[0] = [[NSMutableArray alloc] initWithCapacity:0];
I still get the same repeated error message.
However, if I don't mouse-over the value (or debug) it "appears" to run fine, even doing stuff like:
[viewerPix[0] addObject: dcmPix];
if( [viewerPix[0] count] != [loadList count])...
but if I debug after those steps, it crashes just like before. Here are my build settings:
STRIPFLAGS =
ALTERNATE_GROUP = $(INSTALL_GROUP)
ALTERNATE_OWNER = $(INSTALL_OWNER)
ALTERNATE_MODE = $(INSTALL_MODE_FLAG)
ALTERNATE_PERMISSIONS_FILES =
DEPLOYMENT_LOCATION = NO
DEPLOYMENT_POSTPROCESSING = NO
INSTALL_GROUP = $(GROUP)
INSTALL_OWNER = $(USER)
INSTALL_MODE_FLAG = u+w,go-w,a+rX
DSTROOT = /tmp/$(PROJECT_NAME).dst
INSTALL_PATH = $(HOME)/Applications
SKIP_INSTALL = NO
COPY_PHASE_STRIP = NO
STRIP_INSTALLED_PRODUCT =
STRIP_STYLE = debugging
SEPARATE_STRIP = NO
GCC_FAST_OBJC_DISPATCH = YES
GCC_AUTO_VECTORIZATION = NO
GCC_OBJC_CALL_CXX_CDTORS = YES
GCC_ENABLE_SSE3_EXTENSIONS = NO
GCC_ENABLE_SSE41_EXTENSIONS = NO
GCC_ENABLE_SSE42_EXTENSIONS = NO
GCC_ENABLE_SUPPLEMENTAL_SSE3_INSTRUCTIONS = NO
GCC_STRICT_ALIASING = NO
GCC_FEEDBACK_DIRECTED_OPTIMIZATION = Off
GCC_ENABLE_FIX_AND_CONTINUE = NO
GCC_GENERATE_DEBUGGING_SYMBOLS = YES
GCC_DYNAMIC_NO_PIC = NO
GCC_GENERATE_TEST_COVERAGE_FILES = NO
GCC_INLINES_ARE_PRIVATE_EXTERN = YES
GCC_MODEL_TUNING = G5
GCC_INSTRUMENT_PROGRAM_FLOW_ARCS = NO
GCC_ENABLE_KERNEL_DEVELOPMENT = NO
GCC_DEBUGGING_SYMBOLS = default
GCC_REUSE_STRINGS = YES
GCC_NO_COMMON_BLOCKS = NO
GCC_ENABLE_OBJC_GC = unsupported
GCC_OPTIMIZATION_LEVEL = 0
GCC_FAST_MATH = NO
GCC_ENABLE_SYMBOL_SEPARATION = YES
GCC_THREADSAFE_STATICS = YES
GCC_SYMBOLS_PRIVATE_EXTERN = NO
GCC_UNROLL_LOOPS = NO
GCC_MODEL_PPC64 = NO
I don't know what else to say. Let me know what more information is needed, because I'm at a loss. There's also no 'build' tab when I get-info on the .mm file. Just General, Target, Comments (some helps I checked said to remove file-specific tags).
Should I initialize that c-array to nil? I can't just do.. array[500] = {nil}; right? that's C#?
I was using LLVM and Clang 1.5, but I switched to GCC 4.2 since I wasn't getting any local symbols. Am I missing something??
If the optimizer is on, that can effectively eliminate local variables.
However, why a C array of mutable ObjC arrays? That seems odd.
check Product->Scheme->Edit Scheme->Run xxx, Build Configuration is Debug, if that is Release happened you see.
In doxygen, I can create objective-c categories inside my implementation file to hide interfaces that shouldn't be accessed publicly. However, doxygen still documents the category as the members being "public". Even by adding the \protected or \private, this is still the case.
Is there another method that I'm overlooking that would put this in a "Private Methods" section of that category...or better yet in the same document that the public class is in only listed as private?
Here's part of my config:
#---------------------------------------------------------------------------
# Project related configuration options
#---------------------------------------------------------------------------
DOXYFILE_ENCODING = UTF-8
PROJECT_NAME = "My Project"
PROJECT_NUMBER =
OUTPUT_DIRECTORY = /Users/theuser/Development/myApplication/Documentation
CREATE_SUBDIRS = NO
OUTPUT_LANGUAGE = English
BRIEF_MEMBER_DESC = YES
REPEAT_BRIEF = YES
ABBREVIATE_BRIEF =
ALWAYS_DETAILED_SEC = NO
INLINE_INHERITED_MEMB = NO
FULL_PATH_NAMES = YES
STRIP_FROM_PATH =
STRIP_FROM_INC_PATH =
SHORT_NAMES = NO
JAVADOC_AUTOBRIEF = NO
QT_AUTOBRIEF = NO
MULTILINE_CPP_IS_BRIEF = NO
INHERIT_DOCS = YES
SEPARATE_MEMBER_PAGES = NO
TAB_SIZE = 8
ALIASES =
OPTIMIZE_OUTPUT_FOR_C = NO
OPTIMIZE_OUTPUT_JAVA = NO
OPTIMIZE_FOR_FORTRAN = NO
OPTIMIZE_OUTPUT_VHDL = NO
EXTENSION_MAPPING =
BUILTIN_STL_SUPPORT = NO
CPP_CLI_SUPPORT = NO
SIP_SUPPORT = NO
IDL_PROPERTY_SUPPORT = YES
DISTRIBUTE_GROUP_DOC = NO
SUBGROUPING = YES
TYPEDEF_HIDES_STRUCT = YES
SYMBOL_CACHE_SIZE = 0
#---------------------------------------------------------------------------
# Build related configuration options
#---------------------------------------------------------------------------
EXTRACT_ALL = YES
EXTRACT_PRIVATE = YES
EXTRACT_STATIC = YES
EXTRACT_LOCAL_CLASSES = YES
EXTRACT_LOCAL_METHODS = NO
EXTRACT_ANON_NSPACES = NO
HIDE_UNDOC_MEMBERS = YES
HIDE_UNDOC_CLASSES = YES
HIDE_FRIEND_COMPOUNDS = YES
HIDE_IN_BODY_DOCS = NO
INTERNAL_DOCS = YES
CASE_SENSE_NAMES = NO
HIDE_SCOPE_NAMES = NO
SHOW_INCLUDE_FILES = YES
INLINE_INFO = YES
SORT_MEMBER_DOCS = YES
SORT_BRIEF_DOCS = YES
SORT_GROUP_NAMES = NO
SORT_BY_SCOPE_NAME = NO
GENERATE_TODOLIST = YES
GENERATE_TESTLIST = YES
GENERATE_BUGLIST = YES
GENERATE_DEPRECATEDLIST= YES
ENABLED_SECTIONS =
MAX_INITIALIZER_LINES = 30
SHOW_DIRECTORIES = NO
SHOW_FILES = YES
SHOW_NAMESPACES = YES
FILE_VERSION_FILTER =
LAYOUT_FILE =
Have you tried \internal in code, coupled with INTERNAL_DOCS = NO in Doxyfile?
Another way to put some part of the code out of doxygen scope is to use \cond and \endcond commands.