Get inline rendition instance.
@param mediaArgs Media args
@return Inline rendition instance (may be invalid rendition)
775784
private Rendition getInlineRendition(MediaArgs mediaArgs) {
    return new InlineRendition(this.resource, this.media, mediaArgs, this.fileName, this.adaptable);
  }
961867
private RenditionMetadata getVirtualRendition(RenditionMetadata rendition, long widthValue, long heightValue, double ratioValue) {

    long width = widthValue;
    long height = heightValue;
    double ratio = ratioValue;

    // if ratio is missing: calculate from given rendition
    if (ratio < MediaFormatHandler.RATIO_TOLERANCE) {
      ratio = (double)rendition.getWidth() / (double)rendition.getHeight();
    }

    // if height is missing - calculate from width
    if (height == 0 && width > 0) {
      height = (int)Math.round(width / ratio);
    }

    // if width is missing - calculate from height
    if (width == 0 && height > 0) {
      width = (int)Math.round(height * ratio);
    }

    // return virtual rendition
    if (width > 0 && height > 0) {
      if (rendition instanceof VirtualTransformedRenditionMetadata) {
        VirtualTransformedRenditionMetadata cropRendition = (VirtualTransformedRenditionMetadata)rendition;
        return new VirtualTransformedRenditionMetadata(cropRendition.getRendition(), width, height,
            cropRendition.getCropDimension(), cropRendition.getRotation());
      }
      else {
        return new VirtualRenditionMetadata(rendition.getRendition(), width, height);
      }
    }
    else {
      return null;
    }
  }
89717
public EndpointInfoBuilder availableMimeTypes(Iterable<MediaType> availableMimeTypes) {
        requireNonNull(availableMimeTypes, "availableMimeTypes");
        checkArgument(!Iterables.isEmpty(availableMimeTypes), "Should at least have an available media type.");
        if (defaultMimeType != null && !Iterables.contains(availableMimeTypes, defaultMimeType)) {
            this.availableMimeTypes = addDefaultMimeType(defaultMimeType, availableMimeTypes);
        } else {
            this.availableMimeTypes = ImmutableSet.copyOf(availableMimeTypes);
        }
        return this;
    }
920150
public static @NotNull Dimension getMediaformatDimension(@NotNull Media media) {
    // Create dummy image element to be displayed in Edit mode as placeholder.
    MediaArgs mediaArgs = media.getMediaRequest().getMediaArgs();
    MediaFormat[] mediaFormats = mediaArgs.getMediaFormats();

    // detect width/height - either from media args, or from first media format
    long width = mediaArgs.getFixedWidth();
    long height = mediaArgs.getFixedHeight();
    if ((width == 0 || height == 0) && mediaFormats != null && mediaFormats.length > 0) {
      MediaFormat firstMediaFormat = mediaArgs.getMediaFormats()[0];
      Dimension dimension = firstMediaFormat.getMinDimension();
      if (dimension != null) {
        width = dimension.getWidth();
        height = dimension.getHeight();
      }
    }

    // fallback to min width/height
    if (width == 0) {
      width = MediaMarkupBuilder.DUMMY_MIN_DIMENSION;
    }
    if (height == 0) {
      height = MediaMarkupBuilder.DUMMY_MIN_DIMENSION;
    }

    return new Dimension(width, height);
  }
320840
@SuppressWarnings("null")
  protected final @NotNull String getMediaRefProperty(@NotNull MediaRequest mediaRequest,
      @Nullable MediaHandlerConfig mediaHandlerConfig) {
    String refProperty = mediaRequest.getRefProperty();
    if (StringUtils.isEmpty(refProperty)) {
      if (mediaHandlerConfig != null) {
        refProperty = mediaHandlerConfig.getMediaRefProperty();
      }
      else {
        refProperty = MediaNameConstants.PN_MEDIA_REF;
      }
    }
    return refProperty;
  }
1264576
private Dimension getRequestedDimension() {

    // check for fixed dimensions from media args
    if (mediaArgs.getFixedWidth() > 0 || mediaArgs.getFixedHeight() > 0) {
      return new Dimension(mediaArgs.getFixedWidth(), mediaArgs.getFixedHeight());
    }

    // check for dimensions from mediaformat (evaluate only first media format)
    MediaFormat[] mediaFormats = mediaArgs.getMediaFormats();
    if (mediaFormats != null && mediaFormats.length > 0) {
      Dimension dimension = mediaFormats[0].getMinDimension();
      if (dimension != null) {
        return dimension;
      }
    }

    // fallback to 0/0 - no specific dimension requested
    return new Dimension(0, 0);
  }
371660
protected function getMedia() {
        if (!$this->_media) {
            $this->_media = new MediaList(
                $this->version,
                $this->solution['accountSid'],
                $this->solution['sid']
            );
        }

        return $this->_media;
    }
230919
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
    public static MediaRouter getMediaRouter(Context context) {
        return (MediaRouter) context.getSystemService(Context.MEDIA_ROUTER_SERVICE);
    }
859486
def _get_renditions(self, kwargs):
        
        img_1x, size = self.get_rendition(
            1, **utils.remap_args(kwargs, {"quality": "quality_ldpi"}))
        img_2x, _ = self.get_rendition(
            2, **utils.remap_args(kwargs, {"quality": "quality_hdpi"}))

        return (img_1x, img_2x, size)
699669
protected @Nullable HtmlElement<?> getPictureElement(@NotNull Media media) {
    PictureSource[] pictureSources = media.getMediaRequest().getMediaArgs().getPictureSources();

    Picture picture = new Picture();

    // add source elements (only if matching renditions found)
    boolean foundAnySource = false;
    for (PictureSource pictureSource : pictureSources) {
      Source source = new Source();
      if (pictureSource.getMedia() != null) {
        source.setMedia(pictureSource.getMedia());
      }
      String srcSet = getSrcSetRenditions(media, pictureSource.getMediaFormat(), pictureSource.getWidths());
      if (srcSet != null) {
        source.setSrcSet(srcSet);
        picture.add(source);
        foundAnySource = true;
      }
    }

    // add image element
    HtmlElement<?> image = getImageElement(media);
    if (image == null) {
      return null;
    }

    if (foundAnySource) {
      picture.add(image);
      return picture;
    }
    else {
      return image;
    }
  }
1047840
private static final HttpMessageConverter<?> getHalConverter(List<MediaType> halFlavours) {

		ObjectMapper mapper = new ObjectMapper();
		mapper.registerModule(new Jackson2HalModule());
		mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false);

		MappingJackson2HttpMessageConverter converter = new MappingJackson2HttpMessageConverter();

		converter.setObjectMapper(mapper);
		converter.setSupportedMediaTypes(halFlavours);

		return converter;
	}
621920
@Override
  public @NotNull SortedSet<MediaFormat> getMediaFormats(@NotNull Comparator<MediaFormat> comparator) {
    SortedSet<MediaFormat> set = new TreeSet<>(comparator);
    set.addAll(getMediaFormatsForCurrentResource());
    return ImmutableSortedSet.copyOf(set);
  }
691194
public function getMediaUrl(Media $media, $dispositionType = null)
    {
        $url = $media->getUrl();

        if (ResponseHeaderBag::DISPOSITION_INLINE === $dispositionType) {
            $url .= (false === strpos($url, '?') ? '?inline=1' : '&inline=1');
        } elseif (ResponseHeaderBag::DISPOSITION_ATTACHMENT === $dispositionType) {
            $url .= (false === strpos($url, '?') ? '?inline=0' : '&inline=0');
        }

        return $url;
    }
856804
private boolean addResponsiveImageMediaFormats(MediaArgs mediaArgs) {
    Map<String, MediaFormat> additionalMediaFormats = new LinkedHashMap<>();

    // check if additional on-the-fly generated media formats needs to be added for responsive image handling
    if (!resolveForImageSizes(mediaArgs, additionalMediaFormats)) {
      return false;
    }
    if (!resolveForResponsivePictureSources(mediaArgs, additionalMediaFormats)) {
      return false;
    }

    // if additional media formats where found add them to the media format list in media args
    if (!additionalMediaFormats.isEmpty()) {
      List<MediaFormat> allMediaFormats = new ArrayList<>();
      if (mediaArgs.getMediaFormats() != null) {
        allMediaFormats.addAll(Arrays.asList(mediaArgs.getMediaFormats()));
      }
      allMediaFormats.addAll(additionalMediaFormats.values());
      mediaArgs.mediaFormats(allMediaFormats.toArray(new MediaFormat[allMediaFormats.size()]));
    }

    return true;
  }
184668
public BufferedImage getImage() throws JavaAVException {
		if (open.get()) {
			MediaFrame mediaFrame = demuxer.readFrame();
			if (mediaFrame.getType() == MediaFrame.Type.VIDEO) {
				VideoFrame videoFrame = (VideoFrame) mediaFrame;
				BufferedImage image = Image.createImage(videoFrame, BufferedImage.TYPE_3BYTE_BGR);
				return image;
			}
		}
		return null;
	}
329967
public MediaQueryList parseMedia(final InputSource source) throws IOException {
        source_ = source;
        ReInit(getCharStream(source));
        final MediaQueryList ml = new MediaQueryList();
        try {
            mediaList(ml);
        }
        catch (final ParseException e) {
            getErrorHandler().error(toCSSParseException("invalidMediaList", e));
        }
        catch (final TokenMgrError e) {
            getErrorHandler().error(toCSSParseException(e));
        }
        catch (final CSSParseException e) {
            getErrorHandler().error(e);
        }
        return ml;
    }
252529
protected Rendition getDamRendition(MediaArgs mediaArgs) {
    return new DamRendition(this.damAsset, this.cropDimension, this.rotation, mediaArgs, adaptable);
  }