CN107454457A - The method and device of live resolution ratio is shielded in switching record - Google Patents

The method and device of live resolution ratio is shielded in switching record Download PDF

Info

Publication number
CN107454457A
CN107454457A CN201710506047.9A CN201710506047A CN107454457A CN 107454457 A CN107454457 A CN 107454457A CN 201710506047 A CN201710506047 A CN 201710506047A CN 107454457 A CN107454457 A CN 107454457A
Authority
CN
China
Prior art keywords
resolution ratio
screen
record
current
current screen
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201710506047.9A
Other languages
Chinese (zh)
Other versions
CN107454457B (en
Inventor
黄伟
张文明
陈少杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuhan Douyu Network Technology Co Ltd
Original Assignee
Wuhan Douyu Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wuhan Douyu Network Technology Co Ltd filed Critical Wuhan Douyu Network Technology Co Ltd
Priority to CN201710506047.9A priority Critical patent/CN107454457B/en
Publication of CN107454457A publication Critical patent/CN107454457A/en
Application granted granted Critical
Publication of CN107454457B publication Critical patent/CN107454457B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/433Content storage operation, e.g. storage operation in response to a pause request, caching operations
    • H04N21/4334Recording operations
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/60Network streaming of media packets
    • H04L65/61Network streaming of media packets for supporting one-way streaming services, e.g. Internet radio
    • H04L65/611Network streaming of media packets for supporting one-way streaming services, e.g. Internet radio for multicast or broadcast
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/60Network streaming of media packets
    • H04L65/75Media network packet handling
    • H04L65/762Media network packet handling at the source 
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/44Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs
    • H04N21/4402Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display
    • H04N21/440263Processing of video elementary streams, e.g. splicing a video clip retrieved from local storage with an incoming video stream, rendering scenes according to MPEG-4 scene graphs involving reformatting operations of video signals for household redistribution, storage or real-time display by altering the spatial resolution, e.g. for displaying on a connected PDA
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/45Management operations performed by the client for facilitating the reception of or the interaction with the content or administrating data related to the end-user or to the client device itself, e.g. learning user preferences for recommending movies, resolving scheduling conflicts
    • H04N21/462Content or additional data management, e.g. creating a master electronic program guide from data received from the Internet and a Head-end, controlling the complexity of a video stream by scaling the resolution or bit-rate based on the client capabilities
    • H04N21/4621Controlling the complexity of the content stream or additional data, e.g. lowering the resolution or bit-rate of the video stream for a mobile client with a small screen

Abstract

The present invention relates to direct seeding technique field, more particularly to switching record to shield the method and device of live resolution ratio, and method includes:During record screen is live, monitor whether screen display direction changes;If screen display direction changes, whether the resolution ratio for judging to record screen assembly matches with current screen resolution ratio;If the resolution ratio and current screen resolution ratio of recording screen assembly mismatch, release current Surface components and record the binding relationship between screen assembly;Record screen assembly is bound with newly-built Surface components, and the resolution ratio for recording screen assembly is changed to current screen resolution ratio, and the resolution ratio of encoder is arranged to current screen resolution ratio, and according to the resolution information in the live plug-flow storehouse of resolution update of encoder.The application does not need user that transverse screen or portrait layout display pattern is pre-selected, additionally it is possible to according to record screen it is live during actual screen display direction resolution ratio is automatically adjusted, realize the technique effect that live resolution ratio is shielded in automatic adjusument record.

Description

The method and device of live resolution ratio is shielded in switching record
Technical field
The present invention relates to direct seeding technique field, more particularly to switching record to shield the method and device of live resolution ratio.
Background technology
Record screen is the function that a kind of screen to electronic equipment is recorded a video.At present, Android platform provides MediaProjection interfaces carry out record screen, and the data progress plug-flow that live software can use the interface to obtain record screen is straight Broadcast.
Generally, during record screen is live, different display patterns is may relate to, display pattern includes transverse screen and shows mould Formula and portrait layout display pattern, for example, the preferable display pattern of king's honor is transverse screen display pattern, royal war is preferably shown Pattern is portrait layout display pattern.
Prior art is when record screen is live, it is necessary to which user is configured to display pattern in advance, i.e. in advance by display pattern It is arranged to transverse screen display pattern or portrait layout display pattern.Then, in MediaProjection interface initializations, according to default Display pattern corresponding to resolution ratio carry out record screen it is live.If however, during record screen is live, screen display direction occurs Change, will cause default display pattern and screen actual direction inconsistent, for example, being portrait layout in screen display direction When, it is portrait layout display pattern that user, which pre-sets display pattern, and during record screen is live, screen display direction is cut by portrait layout Transverse screen is shifted to, then, main broadcaster end still can be shown with the resolution ratio corresponding to portrait layout display pattern, so as to cause resolution ratio to damage Lose, image quality is deteriorated, and picture display effect is unintelligible.
The content of the invention
In view of the above problems, it is proposed that the present invention so as to provide one kind overcome above mentioned problem or at least in part solve on The method and device of live resolution ratio is shielded in the switching record for stating problem.
The present invention provides a kind of method for switching record and shielding live resolution ratio, and methods described includes:
During record screen is live, monitor whether screen display direction changes;
If the screen display direction changes, judge to record screen assembly resolution ratio and current screen resolution ratio whether Matching;
If the resolution ratio of the record screen assembly mismatches with the current screen resolution ratio, current Surface groups are released Binding relationship between part and the record screen assembly;
The record screen assembly is bound with newly-built Surface components, and the resolution ratio of the record screen assembly is changed For the current screen resolution ratio, and, the resolution ratio of encoder is arranged to the current screen resolution ratio, and according to described Resolution information in the live plug-flow storehouse of resolution update of encoder.
Preferably, whether the resolution ratio for judging to record screen assembly matches with current screen resolution ratio, including:
Judge it is described record screen assembly predetermined width and preset height between first size relation whether with current screen The second size relationship between width and current screen height matches;
Wherein, if the first size relation, which is the predetermined width, is more than the preset height, and second size Relation is that the current screen width is more than current screen height, then shows the first size relation and second chi Very little relationship match;
If the first size relation, which is the predetermined width, is less than the preset height, and second size relationship is The current screen width is less than current screen height, then shows the first size relation and second size relationship Matching;
If the first size relation, which is the predetermined width, is more than the preset height, and second size relationship is The current screen width is less than current screen height, then shows the first size relation and second size relationship Mismatch;
If the first size relation, which is the predetermined width, is less than the preset height, and second size relationship is The current screen width is more than current screen height, then shows the first size relation and second size relationship Mismatch.
Preferably, after the binding relationship released between current Surface components and the record screen assembly, and It is described by record screen assembly and the newly-built Surface components carry out binding and it is described by the resolution ratio of encoder be arranged to it is described ought Before forth screen resolution ratio, methods described also includes:
The encoder is reset, and the newly-built Surface components are created in the encoder.
Preferably, it is described to be bound the record screen assembly with newly-built Surface components, including:
Initialized in the thread of the encoder for judging whether the newly-built Surface components create what is finished CountDownLatch objects;
Monitor the state of the CountDownLatch objects;
Finished when the state of the CountDownLatch objects shows that the newly-built Surface components have created, by institute Record screen assembly is stated to be bound with the Surface components.
Preferably, whether the monitoring screen display direction changes, including:
Adjusted back using DisplayManager.DisplayListener and monitor whether screen display direction changes.
The embodiment of the present invention also provides a kind of device for switching record and shielding live resolution ratio, and described device includes:
Module is monitored, for during record screen is live, monitoring whether screen display direction changes;
Judge module, if being changed for the screen display direction, judge the resolution ratio of record screen assembly with it is current Whether screen resolution matches;
Module is released, if the resolution ratio for the record screen assembly mismatches with the current screen resolution ratio, is released Binding relationship between current Surface components and the record screen assembly;
Resolution update module, for the record screen assembly to be bound with newly-built Surface components, and by the record The resolution ratio of screen assembly is changed to the current screen resolution ratio, and, the resolution ratio of encoder is arranged to the current screen Curtain resolution ratio, and according to the resolution information in the live plug-flow storehouse of resolution update of the encoder.
Preferably, the judge module, is specifically used for:
Judge it is described record screen assembly predetermined width and preset height between first size relation whether with current screen The second size relationship between width and current screen height matches;
Wherein, if the first size relation, which is the predetermined width, is more than the preset height, and second size Relation is that the current screen width is more than current screen height, then shows the first size relation and second chi Very little relationship match;
If the first size relation, which is the predetermined width, is less than the preset height, and second size relationship is The current screen width is less than current screen height, then shows the first size relation and second size relationship Matching;
If the first size relation, which is the predetermined width, is more than the preset height, and second size relationship is The current screen width is less than current screen height, then shows the first size relation and second size relationship Mismatch;
If the first size relation, which is the predetermined width, is less than the preset height, and second size relationship is The current screen width is more than current screen height, then shows the first size relation and second size relationship Mismatch.
Preferably, described device also includes:
Module is reset, for resetting the encoder, and the newly-built Surface components are created in the encoder.
The embodiment of the present invention also provides a kind of computer-readable recording medium, is stored thereon with computer program, the program Following steps are realized when being executed by processor:
During record screen is live, monitor whether screen display direction changes;
If the screen display direction changes, judge to record screen assembly resolution ratio and current screen resolution ratio whether Matching;
If the resolution ratio of the record screen assembly mismatches with the current screen resolution ratio, current Surface groups are released Binding relationship between part and the record screen assembly;
The record screen assembly is bound with newly-built Surface components, and the resolution ratio of the record screen assembly is changed For the current screen resolution ratio, and, the resolution ratio of encoder is arranged to the current screen resolution ratio, and according to described Resolution information in the live plug-flow storehouse of resolution update of encoder.
The embodiment of the present invention also provides a kind of computer equipment, including memory, processor and storage are on a memory simultaneously The computer program that can be run on a processor, following steps are realized during the computing device described program:
During record screen is live, monitor whether screen display direction changes;
If the screen display direction changes, judge to record screen assembly resolution ratio and current screen resolution ratio whether Matching;
If the resolution ratio of the record screen assembly mismatches with the current screen resolution ratio, current Surface groups are released Binding relationship between part and the record screen assembly;
The record screen assembly is bound with newly-built Surface components, and the resolution ratio of the record screen assembly is changed For the current screen resolution ratio, and, the resolution ratio of encoder is arranged to the current screen resolution ratio, and according to described Resolution information in the live plug-flow storehouse of resolution update of encoder.
One or more of embodiment of the present invention technical scheme, has at least the following technical effects or advantages:
The application is during record screen is live, by monitoring screen display direction, when listening to screen display Direction changes, then whether the resolution ratio for judging to record screen assembly matches with current screen resolution ratio, if the resolution of record screen assembly Rate mismatches with current screen resolution ratio, then releases current Surface components and record the binding relationship between screen assembly, record is shielded Component is bound with newly-built Surface components, and the resolution ratio for recording screen assembly is changed into current screen resolution ratio, meanwhile, The resolution ratio of encoder is arranged to current screen resolution ratio, and according to point in the live plug-flow storehouse of resolution update of encoder Resolution information, the application do not need not only user that transverse screen or portrait layout display pattern is pre-selected, but also can be straight according to record screen Actual screen display direction automatically adjusts to resolution ratio during broadcasting, and realizes automatic adjusument record and shields live resolution ratio Technique effect, it ensure that live picture display effect is shielded in record.
Brief description of the drawings
By reading the detailed description of hereafter preferred embodiment, it is various other the advantages of and benefit it is common for this area Technical staff will be clear understanding.Accompanying drawing is only used for showing the purpose of preferred embodiment, and is not considered as to the present invention Limitation.And in whole accompanying drawing, identical part is represented with identical reference pattern.In the accompanying drawings:
Fig. 1 shows the flow chart of the method for the live resolution ratio of switching record screen in the embodiment of the present invention;
Fig. 2 shows the structure chart of the device of the live resolution ratio of switching record screen in the embodiment of the present invention;
Fig. 3 shows the entity structure schematic diagram of the computer equipment in the embodiment of the present invention.
Embodiment
The exemplary embodiment of the disclosure is more fully described below with reference to accompanying drawings.Although the disclosure is shown in accompanying drawing Exemplary embodiment, it being understood, however, that may be realized in various forms the disclosure without should be by embodiments set forth here Limited.On the contrary, these embodiments are provided to facilitate a more thoroughly understanding of the present invention, and can be by the scope of the present disclosure Completely it is communicated to those skilled in the art.
Embodiments herein provides a kind of method for switching record and shielding live resolution ratio, and it is live that this method is applied to record screen During, and this method is applied to main broadcaster end, as shown in figure 1, methods described includes:
Step 101:During record screen is live, monitor whether screen display direction changes.
Step 102:If the screen display direction changes, the resolution ratio and current screen point of record screen assembly are judged Whether resolution matches.
Step 103:If the resolution ratio of the record screen assembly mismatches with the current screen resolution ratio, release current Binding relationship between Surface components and the record screen assembly.
Step 104:The record screen assembly is bound with newly-built Surface components, and dividing the record screen assembly Resolution is changed to the current screen resolution ratio, and, the resolution ratio of encoder is arranged to the current screen resolution ratio, and According to the resolution information in the live plug-flow storehouse of the resolution update of the encoder.
Wherein, the record screen assembly in the application is the screenshotss serviced component of Android platform, the Surface components in the application Be a handle of original image buffering area, the content of image can be obtained by Surface components, only record screen assembly and Surface component bindings together when, record screen assembly can obtain image.
Further, the application is during record screen is live, by monitoring screen display direction, shields when listening to Curtain display direction changes, then whether the resolution ratio for judging to record screen assembly matches with current screen resolution ratio, if record screen assembly Resolution ratio and current screen resolution ratio mismatch, then release current Surface components and record the binding relationship between screen assembly, Record screen assembly is bound with newly-built Surface components, and the resolution ratio for recording screen assembly is changed to current screen resolution ratio, Meanwhile the resolution ratio of encoder is arranged to current screen resolution ratio, and according to the live plug-flow storehouse of resolution update of encoder In resolution information, the application do not need not only user that transverse screen or portrait layout display pattern is pre-selected, but also being capable of basis Actual screen display direction automatically adjusts to resolution ratio during record screen is live, realizes live point of automatic adjusument record screen The technique effect of resolution, it ensure that live picture display effect is shielded in record.
In this application, for step 101, conventional monitor method includes using OnConfigurationChanged is monitored and monitored using onOrientationChanged.Using OnConfigurationChanged monitors the screen associated change event for being only capable of monitoring application, other applications thing Part can not be monitored, for example, king's honor that transverse screen is switched to from the mobile phone homepage of portrait layout will be unable to accurately listen to.Using OnOrientationChanged, which is monitored, to be only capable of monitoring the screen change event for causing sensor to change by mobile phone rotation, and user Screen change event caused by operation application program can not be monitored.
However, the application monitors screen display direction, energy using DisplayManager.DisplayListener readjustments Enough overcome the shortcomings of above two monitor method, all screen display direction changes are accurately and efficiently monitored in realization.
In this application, in order to avoid erroneous judgement, changed when listening to screen display direction, it is necessary to perform further Judge, i.e. whether the resolution ratio for judging to record screen assembly matches with current screen resolution ratio.Specifically, it is live for record screen, with The related component of resolution ratio includes:Record screen assembly (MediaProjection), Surface components, encoder and live plug-flow Storehouse, if the resolution ratio of said modules mismatches with main broadcaster's end equipment true resolution, resolution ratio will be caused impaired or schemed As display is abnormal.
Further, whether match, can be used with current screen resolution ratio for the resolution ratio for how judging to record screen assembly Following methods:
First, record screen assembly has predetermined width and preset height, and predetermined width and preset height have first size pass System, for example, predetermined width is more than preset height, or, predetermined width is less than preset height, and, current screen has actual screen Curtain width and screen height, i.e.,:Current screen width and current screen height, current screen height and current screen width have Second size relationship, for example, current screen is highly more than current screen width, or, to be highly less than current screen wide for current screen Degree.
Secondly, the application is shielded by judging whether first size relation matches with the second size relationship with realizing to record The judgement whether resolution ratio of component matches with current screen resolution ratio.Specifically, if first size relation is that predetermined width is big In preset height, and, the second size relationship be current screen width be more than current screen height, then show first size relation with The second size relationship matching.If first size relation, which is predetermined width, is less than preset height, and, the second size relationship is to work as Forth screen width is less than current screen height, then shows that first size relation matches with the second size relationship.If first size closes It is to be more than preset height for predetermined width, and, the second size relationship is that current screen width is less than current screen height, then shows First size relation mismatches with the second size relationship.If first size relation, which is predetermined width, is less than preset height, and, second Size relationship is that current screen width is more than current screen height, then does not show first size relation and the second size relationship not Match somebody with somebody.Further, if first size relation mismatches with the second size relationship, show to record the resolution ratio and current screen of screen assembly Resolution ratio mismatches, if first size relation matches with the second size relationship, shows to record the resolution ratio of screen assembly and current screen Curtain resolution match.
It should be noted that if screen display direction does not change, it is failure to actuate, equally, if point of record screen assembly Resolution and current screen resolution match, are also failure to actuate, and keep current screen resolution ratio constant.
Further, when the resolution ratio for recording screen assembly mismatches with current screen resolution ratio, if not resetting current Surface Component, it will there is image and show the problem of incomplete, therefore, for step 103, if the resolution ratio of record screen assembly with it is current Screen resolution mismatches, and the application will release current Surface components and record the binding relationship between screen assembly, with after an action of the bowels Continue newly-built Surface components, and record screen assembly is bound with newly-built Surface components.Specifically, interface can be passed through MVirtualDisplay.setSurface (null) is unbinding.
It should be noted that the application before resetting encoder and resetting the resolution ratio of record screen assembly, releases current Binding relationship between Surface components and record screen assembly, so that old resolution data and the isolation of new resolution data, are avoided Encoder or the data of plug-flow storehouse processing are still old resolution data, but set advancing updating.
In this application, after the binding relationship between current Surface components and record screen assembly is released, and described Record screen assembly and newly-built Surface components are carried out binding and described the resolution ratio of encoder be arranged into current screen resolution ratio Before, methods described also includes:
Encoder is reset, and creates newly-built Surface components in the encoder.
In specific implementation process, the process of encoder is reset, namely encoder is reinitialized, and it is newly-built Surface components then create in the encoder, specifically, the interface that Android platform can be used to provide CreateInputSurface () is created.
In specific implementation process, the thread of the thread and encoder of recording screen assembly is two independent threads, encoder The newly-built Surface components of thread creation, the thread for recording screen assembly binds the newly-built Surface components, and both are asynchronous operation, The thread for recording screen assembly provides data in the thread of encoder, when providing data every time, only sends a message, then carries out The processing of next frame, therefore, finishing if newly-built Surface components not yet create, live disconnection will be caused by just carrying out binding, The application solves the problem using CountDownLatch, specifically, described by the record screen assembly and newly-built Surface components Bound, including:
Initialized in the thread of the encoder for judging whether the newly-built Surface components create what is finished CountDownLatch objects;
Monitor the state of the CountDownLatch objects;
Finished when the state of the CountDownLatch objects shows that the newly-built Surface components have created, by institute Record screen assembly is stated to be bound with the Surface components.
In specific implementation process, a CountDownLatch object is initialized in the thread of encoder, should CountDownLatch objects can be CountDownLatch (1), and 1, which shows that newly-built Surface components do not create, finishes, and then Record screen assembly to wait, when CountDownLatch objects are changed into CountDownLatch (0) then tables from CountDownLatch (1) Bright newly-built Surface building components are finished, and then stop waiting, and record screen assembly is bound with Surface components.
In the step 104 of the application, newly-built show can be bound again by recording the setSurface interfaces of screen assembly Component, then calling interface resize by record screen assembly resolution ratio be changed to current screen resolution ratio.In addition, in step 104 In, because encoder is reset, coding restarts, it will produces a coding header packet information, live plug-flow storehouse can pass through Judge whether current bag is that the header packet information to judge whether to need to update resolution ratio indirectly, if current bag is the header packet information When, then live plug-flow storehouse writes new resolution information, it is ensured that upgrade in time resolution ratio.
Based on same inventive concept, the embodiment of the present application also provides a kind of device for switching record and shielding live resolution ratio, such as Fig. 2 Shown, described device includes:
Module 201 is monitored, for during record screen is live, monitoring whether screen display direction changes;
Judge module 202, if being changed for the screen display direction, judge the resolution ratio of record screen assembly with working as Whether forth screen resolution ratio matches;
Module 203 is released, if the resolution ratio for the record screen assembly mismatches with the current screen resolution ratio, is solved Except the binding relationship between current Surface components and the record screen assembly;
Resolution update module 204, for the record screen assembly to be bound with newly-built Surface components, and by institute The resolution ratio for stating record screen assembly is changed to the current screen resolution ratio, and, the resolution ratio of encoder is arranged to described and worked as Forth screen resolution ratio, and according to the resolution information in the live plug-flow storehouse of resolution update of the encoder.
Preferably, judge module 202, it is specifically used for:
Judge it is described record screen assembly predetermined width and preset height between first size relation whether with current screen The second size relationship between width and current screen height matches;
Wherein, if the first size relation, which is the predetermined width, is more than the preset height, and second size Relation is that the current screen width is more than current screen height, then shows the first size relation and second chi Very little relationship match;
If the first size relation, which is the predetermined width, is less than the preset height, and second size relationship is The current screen width is less than current screen height, then shows the first size relation and second size relationship Matching;
If the first size relation, which is the predetermined width, is more than the preset height, and second size relationship is The current screen width is less than current screen height, then shows the first size relation and second size relationship Mismatch;
If the first size relation, which is the predetermined width, is less than the preset height, and second size relationship is The current screen width is more than current screen height, then shows the first size relation and second size relationship Mismatch.
Preferably, described device also includes:
Module is reset, for resetting the encoder, and the newly-built Surface components are created in the encoder.
Preferably, resolution update module 204, including:
Creating unit, it is used to judge that the newly-built Surface components are for initializing in the thread of the encoder It is no to create the CountDownLatch objects finished;
Monitoring unit, for monitoring the state of the CountDownLatch objects;
Binding unit, for having shown the newly-built Surface components when the state of the CountDownLatch objects Establishment is finished, and the record screen assembly is bound with the Surface components.
Preferably, module 201 is monitored, is specifically used for:
Adjusted back using DisplayManager.DisplayListener and monitor whether screen display direction changes.
Based on same inventive concept, the embodiment of the present invention also provides a kind of computer-readable recording medium, is stored thereon with Computer program, the program realize following steps when being executed by processor:
During record screen is live, monitor whether screen display direction changes;
If the screen display direction changes, judge to record screen assembly resolution ratio and current screen resolution ratio whether Matching;
If the resolution ratio of the record screen assembly mismatches with the current screen resolution ratio, current Surface groups are released Binding relationship between part and the record screen assembly;
The record screen assembly is bound with newly-built Surface components, and the resolution ratio of the record screen assembly is changed For the current screen resolution ratio, and, the resolution ratio of encoder is arranged to the current screen resolution ratio, and according to described Resolution information in the live plug-flow storehouse of resolution update of encoder.
The embodiment of the present invention additionally provides a kind of computer equipment, as shown in figure 3, for convenience of description, illustrate only with The related part of the embodiment of the present invention, particular technique details do not disclose, refer to present invention method part.The calculating Machine equipment can be include mobile phone, tablet personal computer, PDA (Personal Digital Assistant, personal digital assistant), Any terminal devices such as POS (Point of Sales, point-of-sale terminal), vehicle-mounted computer, so that computer equipment is mobile phone as an example:
Fig. 3 is illustrated that the block diagram of the part-structure related to computer equipment provided in an embodiment of the present invention.Reference chart 3, the computer equipment includes:Memory 301 and processor 302.It will be understood by those skilled in the art that the meter shown in Fig. 3 Calculation machine equipment structure does not form the restriction to computer equipment, can include than illustrating more or less parts, or group Close some parts, or different parts arrangement.
Each component parts of computer equipment is specifically introduced with reference to Fig. 3:
Memory 301 can be used for storage software program and module, and processor 302 is stored in memory 301 by operation Software program and module, so as to perform various function application and data processing.Memory 301 can mainly include storage journey Sequence area and storage data field, wherein, storing program area can storage program area, the application program (ratio needed at least one function Such as sound-playing function, image player function) etc.;Storage data field can data storage (such as voice data, phone directory etc.) Deng.In addition, memory 301 can include high-speed random access memory, nonvolatile memory can also be included, for example, at least One disk memory, flush memory device or other volatile solid-state parts.
Processor 302 is the control centre of computer equipment, by running or performing the software being stored in memory 301 Program and/or module, and the data being stored in memory 301 are called, perform various functions and processing data.Optionally, Processor 302 may include one or more processing units;Preferably, processor 302 can integrate application processor and modulation /demodulation Processor, wherein, application processor mainly handles operating system, user interface and application program etc., modem processor master Handle radio communication.
In embodiments of the present invention, the processor 302 included by the computer equipment can have following functions:
During record screen is live, monitor whether screen display direction changes;
If the screen display direction changes, judge to record screen assembly resolution ratio and current screen resolution ratio whether Matching;
If the resolution ratio of the record screen assembly mismatches with the current screen resolution ratio, current Surface groups are released Binding relationship between part and the record screen assembly;
The record screen assembly is bound with newly-built Surface components, and the resolution ratio of the record screen assembly is changed For the current screen resolution ratio, and, the resolution ratio of encoder is arranged to the current screen resolution ratio, and according to described Resolution information in the live plug-flow storehouse of resolution update of encoder.
In a word, the application is during record screen is live, by monitoring screen display direction, when listening to screen Display direction changes, then whether the resolution ratio for judging to record screen assembly matches with current screen resolution ratio, if record screen assembly Resolution ratio mismatches with current screen resolution ratio, then releases current Surface components and record the binding relationship between screen assembly, will Record screen assembly is bound with newly-built Surface components, and the resolution ratio for recording screen assembly is changed into current screen resolution ratio, together When, the resolution ratio of encoder is arranged to current screen resolution ratio, and in the live plug-flow storehouse of resolution update according to encoder Resolution information, the application do not need not only user that transverse screen or portrait layout display pattern is pre-selected, but also can be according to record Shield it is live during actual screen display direction resolution ratio is automatically adjusted, realize automatic adjusument record and shield live resolution The technique effect of rate, it ensure that live picture display effect is shielded in record.
Algorithm and display be not inherently related to any certain computer, virtual system or miscellaneous equipment provided herein. Various general-purpose systems can also be used together with teaching based on this.As described above, required by constructing this kind of system Structure be obvious.In addition, the present invention is not also directed to any certain programmed language.It should be understood that it can utilize various Programming language realizes the content of invention described herein, and the description done above to language-specific is to disclose this hair Bright preferred forms.
In the specification that this place provides, numerous specific details are set forth.It is to be appreciated, however, that the implementation of the present invention Example can be put into practice in the case of these no details.In some instances, known method, structure is not been shown in detail And technology, so as not to obscure the understanding of this description.
Similarly, it will be appreciated that in order to simplify the disclosure and help to understand one or more of each inventive aspect, Above in the description to the exemplary embodiment of the present invention, each feature of the invention is grouped together into single implementation sometimes In example, figure or descriptions thereof.However, the method for the disclosure should be construed to reflect following intention:I.e. required guarantor The application claims of shield features more more than the feature being expressly recited in each claim.It is more precisely, such as following Claims reflect as, inventive aspect is all features less than single embodiment disclosed above.Therefore, Thus the claims for following embodiment are expressly incorporated in the embodiment, wherein each claim is in itself Separate embodiments all as the present invention.
Those skilled in the art, which are appreciated that, to be carried out adaptively to the module in the equipment in embodiment Change and they are preset in one or more equipment different from the embodiment.Can be the module or list in embodiment Member or component be combined into a module or unit or component, and can be divided into addition multiple submodule or subelement or Sub-component.In addition at least some in such feature and/or process or unit exclude each other, it can use any Combination is disclosed to all features disclosed in this specification (including adjoint claim, summary and accompanying drawing) and so to appoint Where all processes or unit of method or equipment are combined.Unless expressly stated otherwise, this specification (including adjoint power Profit requires, summary and accompanying drawing) disclosed in each feature can be by providing the alternative features of identical, equivalent or similar purpose come generation Replace.
In addition, it will be appreciated by those of skill in the art that although some embodiments in this include institute in other embodiments Including some features rather than further feature, but the combination of the feature of different embodiments means to be in the scope of the present invention Within and form different embodiments.For example, in the following claims, embodiment claimed it is any it One mode can use in any combination.
The all parts embodiment of the present invention can be realized with hardware, or to be run on one or more processor Software module realize, or realized with combinations thereof.It will be understood by those of skill in the art that it can use in practice Microprocessor or digital signal processor (DSP) are realized in gateway according to embodiments of the present invention, proxy server, system Some or all parts some or all functions.The present invention is also implemented as being used to perform side as described herein The some or all equipment or program of device (for example, computer program and computer program product) of method.It is such Realizing the program of the present invention can store on a computer-readable medium, or can have the shape of one or more signal Formula.Such signal can be downloaded from internet website and obtained, and either be provided or with any other shape on carrier signal Formula provides.
It should be noted that the present invention will be described rather than limits the invention for above-described embodiment, and ability Field technique personnel can design alternative embodiment without departing from the scope of the appended claims.In the claims, Any reference symbol between bracket should not be configured to limitations on claims.Word "comprising" does not exclude the presence of not Element or step listed in the claims.Word "a" or "an" before element does not exclude the presence of multiple such Element.The present invention can be by means of including the hardware of some different elements and being come by means of properly programmed computer real It is existing.In if the unit claim of equipment for drying is listed, several in these devices can be by same hardware branch To embody.Word, second and third use do not indicate that any order.These words can be construed to title.

Claims (10)

  1. A kind of 1. method for switching record and shielding live resolution ratio, it is characterised in that methods described includes:
    During record screen is live, monitor whether screen display direction changes;
    If the screen display direction changes, judge to record screen assembly resolution ratio and current screen resolution ratio whether Match somebody with somebody;
    If resolution ratio and the current screen resolution ratio of the record screen assembly mismatch, release current Surface components with Binding relationship between the record screen assembly;
    The record screen assembly is bound with newly-built Surface components, and the resolution ratio of the record screen assembly is changed to institute Current screen resolution ratio is stated, and, the resolution ratio of encoder is arranged to the current screen resolution ratio, and according to the coding Resolution information in the live plug-flow storehouse of resolution update of device.
  2. 2. the method as described in claim 1, it is characterised in that the resolution ratio for judging record screen assembly is differentiated with current screen Whether rate matches, including:
    Judge it is described record screen assembly predetermined width and preset height between first size relation whether with current screen width The second size relationship between current screen height matches;
    Wherein, if the first size relation, which is the predetermined width, is more than the preset height, and second size relationship It is more than current screen height for the current screen width, then shows that the first size relation is closed with second size System's matching;
    If the first size relation, which is the predetermined width, is less than the preset height, and second size relationship is described Current screen width is less than current screen height, then shows the first size relation and second size relationship Match somebody with somebody;
    If the first size relation, which is the predetermined width, is more than the preset height, and second size relationship is described Current screen width is less than current screen height, then does not show the first size relation and second size relationship not Match somebody with somebody;
    If the first size relation, which is the predetermined width, is less than the preset height, and second size relationship is described Current screen width is more than current screen height, then does not show the first size relation and second size relationship not Match somebody with somebody.
  3. 3. the method as described in claim 1, it is characterised in that release current Surface components and the record screen group described After binding relationship between part, and the record screen assembly and newly-built Surface components are subjected to binding and the general described The resolution ratio of encoder is arranged to before the current screen resolution ratio, and methods described also includes:
    The encoder is reset, and the newly-built Surface components are created in the encoder.
  4. 4. method as claimed in claim 3, it is characterised in that described to enter the record screen assembly with newly-built Surface components Row binding, including:
    Initialized in the thread of the encoder for judging whether the newly-built Surface components create what is finished CountDownLatch objects;
    Monitor the state of the CountDownLatch objects;
    Finished when the state of the CountDownLatch objects shows that the newly-built Surface components have created, by the record Screen assembly is bound with the Surface components.
  5. 5. the method as described in claim 1, it is characterised in that whether the monitoring screen display direction changes, including:
    Adjusted back using DisplayManager.DisplayListener and monitor whether screen display direction changes.
  6. 6. a kind of device for switching record and shielding live resolution ratio, it is characterised in that described device includes:
    Module is monitored, for during record screen is live, monitoring whether screen display direction changes;
    Judge module, if being changed for the screen display direction, judge the resolution ratio and current screen of record screen assembly Whether resolution ratio matches;
    Module is released, if the resolution ratio for the record screen assembly mismatches with the current screen resolution ratio, is released current Binding relationship between Surface components and the record screen assembly;
    Resolution update module, for the record screen assembly to be bound with newly-built Surface components, and screen group is recorded by described The resolution ratio of part is changed to the current screen resolution ratio, and, the resolution ratio of encoder is arranged to the current screen point Resolution, and according to the resolution information in the live plug-flow storehouse of resolution update of the encoder.
  7. 7. device as claimed in claim 6, it is characterised in that the judge module, be specifically used for:
    Judge it is described record screen assembly predetermined width and preset height between first size relation whether with current screen width The second size relationship between current screen height matches;
    Wherein, if the first size relation, which is the predetermined width, is more than the preset height, and second size relationship It is more than current screen height for the current screen width, then shows that the first size relation is closed with second size System's matching;
    If the first size relation, which is the predetermined width, is less than the preset height, and second size relationship is described Current screen width is less than current screen height, then shows the first size relation and second size relationship Match somebody with somebody;
    If the first size relation, which is the predetermined width, is more than the preset height, and second size relationship is described Current screen width is less than current screen height, then does not show the first size relation and second size relationship not Match somebody with somebody;
    If the first size relation, which is the predetermined width, is less than the preset height, and second size relationship is described Current screen width is more than current screen height, then does not show the first size relation and second size relationship not Match somebody with somebody.
  8. 8. device as claimed in claim 6, it is characterised in that described device also includes:
    Module is reset, for resetting the encoder, and the newly-built Surface components are created in the encoder.
  9. 9. a kind of computer-readable recording medium, is stored thereon with computer program, it is characterised in that the program is held by processor Following steps are realized during row:
    During record screen is live, monitor whether screen display direction changes;
    If the screen display direction changes, judge to record screen assembly resolution ratio and current screen resolution ratio whether Match somebody with somebody;
    If resolution ratio and the current screen resolution ratio of the record screen assembly mismatch, release current Surface components with Binding relationship between the record screen assembly;
    The record screen assembly is bound with newly-built Surface components, and the resolution ratio of the record screen assembly is changed to institute Current screen resolution ratio is stated, and, the resolution ratio of encoder is arranged to the current screen resolution ratio, and according to the coding Resolution information in the live plug-flow storehouse of resolution update of device.
  10. 10. a kind of computer equipment, including memory, processor and storage are on a memory and the meter that can run on a processor Calculation machine program, it is characterised in that realize following steps during the computing device described program:
    During record screen is live, monitor whether screen display direction changes;
    If the screen display direction changes, judge to record screen assembly resolution ratio and current screen resolution ratio whether Match somebody with somebody;
    If resolution ratio and the current screen resolution ratio of the record screen assembly mismatch, release current Surface components with Binding relationship between the record screen assembly;
    The record screen assembly is bound with newly-built Surface components, and the resolution ratio of the record screen assembly is changed to institute Current screen resolution ratio is stated, and, the resolution ratio of encoder is arranged to the current screen resolution ratio, and according to the coding Resolution information in the live plug-flow storehouse of resolution update of device.
CN201710506047.9A 2017-06-28 2017-06-28 Method and device for switching live broadcast resolution of screen recording Active CN107454457B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710506047.9A CN107454457B (en) 2017-06-28 2017-06-28 Method and device for switching live broadcast resolution of screen recording

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710506047.9A CN107454457B (en) 2017-06-28 2017-06-28 Method and device for switching live broadcast resolution of screen recording

Publications (2)

Publication Number Publication Date
CN107454457A true CN107454457A (en) 2017-12-08
CN107454457B CN107454457B (en) 2020-01-03

Family

ID=60487232

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710506047.9A Active CN107454457B (en) 2017-06-28 2017-06-28 Method and device for switching live broadcast resolution of screen recording

Country Status (1)

Country Link
CN (1) CN107454457B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109413457A (en) * 2018-10-18 2019-03-01 武汉斗鱼网络科技有限公司 Code stream clarity switching method, device, terminal and the readable medium of android system
CN109413344A (en) * 2018-10-26 2019-03-01 北京计算机技术及应用研究所 Multiresolution screen operator state monitoring apparatus based on video acquisition and coding techniques
CN110337005A (en) * 2019-07-09 2019-10-15 南京雷鲨信息科技有限公司 Record screen method, system, intelligent terminal and the computer readable storage medium of intelligent terminal
CN110798700A (en) * 2019-11-07 2020-02-14 网易(杭州)网络有限公司 Video processing method, video processing device, storage medium and electronic equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2160024A2 (en) * 2008-09-01 2010-03-03 Lg Electronics Inc. Terminal, controlling method thereof and recordable medium for the same
CN104581405A (en) * 2013-10-21 2015-04-29 中国移动通信集团公司 Display content processing method and equipment
CN106303661A (en) * 2016-08-29 2017-01-04 武汉斗鱼网络科技有限公司 A kind of live client realizes the method and system of self adaptation screen rotation

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2160024A2 (en) * 2008-09-01 2010-03-03 Lg Electronics Inc. Terminal, controlling method thereof and recordable medium for the same
CN104581405A (en) * 2013-10-21 2015-04-29 中国移动通信集团公司 Display content processing method and equipment
CN106303661A (en) * 2016-08-29 2017-01-04 武汉斗鱼网络科技有限公司 A kind of live client realizes the method and system of self adaptation screen rotation

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109413457A (en) * 2018-10-18 2019-03-01 武汉斗鱼网络科技有限公司 Code stream clarity switching method, device, terminal and the readable medium of android system
CN109413457B (en) * 2018-10-18 2021-11-09 武汉斗鱼网络科技有限公司 Code stream definition switching method and device for Android system, terminal and readable medium
CN109413344A (en) * 2018-10-26 2019-03-01 北京计算机技术及应用研究所 Multiresolution screen operator state monitoring apparatus based on video acquisition and coding techniques
CN110337005A (en) * 2019-07-09 2019-10-15 南京雷鲨信息科技有限公司 Record screen method, system, intelligent terminal and the computer readable storage medium of intelligent terminal
CN110337005B (en) * 2019-07-09 2021-05-28 南京雷鲨信息科技有限公司 Screen recording method and system of intelligent terminal, intelligent terminal and computer readable storage medium
CN110798700A (en) * 2019-11-07 2020-02-14 网易(杭州)网络有限公司 Video processing method, video processing device, storage medium and electronic equipment

Also Published As

Publication number Publication date
CN107454457B (en) 2020-01-03

Similar Documents

Publication Publication Date Title
CN107454457A (en) The method and device of live resolution ratio is shielded in switching record
US9697447B2 (en) Automated generation of QR codes with embedded images
CN105045643B (en) Launcher startup method and device in Android system
CN104346267B (en) Generate the method and device of bugs location information
CN104704468B (en) The cross-system installation of WEB application program
CN104778178B (en) A kind of application class method, apparatus and service server
CN110166810A (en) Video rendering engine switching method, device, equipment and readable storage medium storing program for executing
CN107493510A (en) Live TV stream player method, device, computer-readable storage medium and equipment in direct broadcasting room
CN106897318A (en) The methods of exhibiting and device of five application page on mobile terminal device
CN105553968A (en) Method and device for realizing login by multiple accounts
CN107798064A (en) Page processing method, electronic equipment and computer-readable recording medium
CN105554424A (en) Method and apparatus for video playing in application
CN104461741B (en) Graphics device interface based computing device optimizing method and device
CN109361806A (en) Black number storage method, black number mark method, system and device
US10628182B2 (en) Generation of an instruction guide based on a current hardware configuration of a system
US9207703B1 (en) Method and apparatus for client application customization
CN107707980A (en) Play page layering system, specify extended method, medium and the equipment of player
US20230214153A1 (en) Memory device forensics and preparation
US10242315B2 (en) Finite state machine forming
CN113419763B (en) Data processing method, device, equipment and storage medium
US10291743B2 (en) Configuring service endpoints in native client applications
CN110175021A (en) The exchange method of application program and webpage, system and storage medium
US9972109B2 (en) Implementing out of order access to reversal operations in images
CN107908410A (en) Plug-in unit backup, operation method, device, terminal device and storage medium
CN108241748A (en) Obtain method, apparatus, medium and the equipment of live streaming musical designation

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant